Having troubles using XkbKeycodeToKeysym

Alan Coopersmith alan.coopersmith at oracle.com
Thu May 2 16:18:00 UTC 2024


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));


-- 
         -Alan Coopersmith-                 alan.coopersmith at oracle.com
          Oracle Solaris Engineering - https://blogs.oracle.com/solaris



More information about the xorg mailing list