Greetings all.
I'm trying to figure out how to use a library function but am clueless really
I want to use the XKeycodeToKeysym() command from the Xlib
I tried this..
Extern XKeycodeToKeysym(Disp As Object, code As Integer, Index As Integer) As String In "Xlib"
That does not work. says cannot find xlib.so
fumbling around in the dark here
Any clues would be appreciated.
Tia.
Bruce.
External libraries
- BruceSteers
- Posts: 1578
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
External libraries
If at first you don't succeed , try doing something differently.
BruceS
BruceS
Re: External libraries
I think you are missing the Library declaration, take a look at my post: https://captainbodgit.blogspot.com/2019 ... aries.htmlBruceSteers wrote: ↑Friday 13th November 2020 7:16pm ...I'm trying to figure out how to use a library function...
In the meantime I'll take a look at xlib
Re: External libraries
Looks like the library you require is libx11: https://helpmanual.io/packages/apt/libx11-doc/
...we just got to figure out how to reference it
...we just got to figure out how to reference it
- BruceSteers
- Posts: 1578
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: External libraries
Cheers Steve with that nudge i've found the library with using libX11 (capital X)
thank you , i can play with that now, just gotta work out how to pass the args like "Display"
thank you , i can play with that now, just gotta work out how to pass the args like "Display"
If at first you don't succeed , try doing something differently.
BruceS
BruceS
Re: External libraries
I don't know if you have already found this: http://gambaswiki.org/wiki/howto/externBruceSteers wrote: ↑Friday 13th November 2020 10:12pm ...just gotta work out how to pass the args like "Display"
I think the Display argument is a pointer.
Good luck Bruce.
Re: External libraries
Yes, he has to use a Pointer data type.
@BruceSteers
Here a few years ago I wrote some examples (text in italian) using the external functions of the X11 library in Gambas:
https://www.gambas-it.org/wiki/index.ph ... API_di_X11
Europaeus sum !
Amare memorentes atque deflentes ad mortem silenter labimur.
Amare memorentes atque deflentes ad mortem silenter labimur.
- BruceSteers
- Posts: 1578
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: External libraries
Yes, cheers , been reading up where i can. heading into C world though , so much more complex than basic lol.stevedee wrote: ↑Friday 13th November 2020 10:34pmI don't know if you have already found this: http://gambaswiki.org/wiki/howto/externBruceSteers wrote: ↑Friday 13th November 2020 10:12pm ...just gotta work out how to pass the args like "Display"
I think the Display argument is a pointer.
Good luck Bruce.
Definitely giving me a headache :-\
I may just blow it all out and make my app gtk only.
Key codes all seem fine and match keysymdef.h file on GTK , QT though , pah
If at first you don't succeed , try doing something differently.
BruceS
BruceS
Re: External libraries
Ideally, everyone should learn C.BruceSteers wrote: ↑Friday 13th November 2020 11:45pm
....heading into C world though , so much more complex than basic...
Even if you never use it, having that background information is very useful when working with other languages and operating systems.
Definitely giving me a headache :-\
lol, try C++ for a full blown migraine!
Re: External libraries
These are great examples vuott, and what a brilliant Gambas wiki!vuott wrote: ↑Friday 13th November 2020 11:25pm ...Here a few years ago I wrote some examples (text in italian) using the external functions of the X11 library in Gambas:
https://www.gambas-it.org/wiki/index.ph ... API_di_X11
- BruceSteers
- Posts: 1578
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: External libraries
I gave up in the end lol, thanks for the help though , i tried.
I thought i was doing it right, i used the opendisplay command using Pointers then tried to use the function i wanted, then closedisplay.
Just got a segmentation 11 fault each time
But i found a work-around for now to get my macro recorder working (mostly) on QT.
I just have one little issue to deal with with a menu shortcut to play the macro.
On GTK if i hit F7 to play the macro and the macro calls a F3 (search) hit, it runs where it should.
On QT it seems the F3 hit does not get sent till all the macros have played out. (i'm guessing i'm locked in the KeyPress() function and the F3 hit does not function till out of the KeyPress function.) annoying as it does not happen on GTK just QT.
But thanks for the links guys , useful resources for me to look at if i try again .
All the best
Bruce
I thought i was doing it right, i used the opendisplay command using Pointers then tried to use the function i wanted, then closedisplay.
Just got a segmentation 11 fault each time
But i found a work-around for now to get my macro recorder working (mostly) on QT.
I just have one little issue to deal with with a menu shortcut to play the macro.
On GTK if i hit F7 to play the macro and the macro calls a F3 (search) hit, it runs where it should.
On QT it seems the F3 hit does not get sent till all the macros have played out. (i'm guessing i'm locked in the KeyPress() function and the F3 hit does not function till out of the KeyPress function.) annoying as it does not happen on GTK just QT.
But thanks for the links guys , useful resources for me to look at if i try again .
All the best
Bruce
If at first you don't succeed , try doing something differently.
BruceS
BruceS