Hi,
I found out what was the problem while writing a little test program as
Enrico Weigelt asked: my test program worked properly. My real program
wasn't working properly because I was not passing a struct as a pointer
somewhere, and gcc didn't showed me a warning nor an error message,
because I didn't noticed that they were not in the header.
Thanks a lot for your help!
Mibi88
Le 02/05/2024 à 18:18, Alan Coopersmith a écrit :
On 5/1/24 02:39, Mibi88 wrote:
Hello,
I hope that I'm asking on the right place for help, if not, where
should I ask for help about XLib?
I'm writing a program that uses opengl, glx and xlib. Everything
works fine, I can get the mouse position, the mouse button press
events etc. But when I try to get Symcodes from keycodes, my program
just segfaults. I checked the arguments I'm passing multiple times, I
tried using XKeycodeToKeysym...
I tested it on another computer, and I had the same issue.
I'm getting the event like this:
if(XPending(window->display)){
XNextEvent(window->display, &window->event);
if(window->event.type== KeymapNotify){
That should be MappingNotify, not KeymapNotify, as described in:
https://tronche.com/gui/x/xlib/events/window-state-change/mapping.html
XRefreshKeyboardMapping(&(window->event.xmapping));