Hi,

> Here is some code:
> 
> ---
> Bool changeGroup(int increment) {
>   if (GroupCount <= 1) return False;
>   XkbLockGroup(dsp, deviceID, (CurrentGroupXKBNo + GroupCount + increment) %
> GroupCount);
>   return True;
> }
> ---
There is nothing wrong here.  But it is too less to understand the reason.

> The GroupCount, dsp, deviceID and CurrentGroupXKBNo are all initialized
> properly, but the XkbLockGroup() call has no effect.
> If someone has any ideas I would be very grateful.

Ideas...  Probably you didn't initialize XKB extension itself with
XkbQueryExtension or XkbOpenDisplay.  Or you use wrong deviceID.

This example works:
------------------------
#include <X11/Xlib.h>
#include <X11/extensions/XKB.h>
#include <X11/extensions/XKBstr.h>

main(int argc, char *argv[])
{
   Display *dpy;
   int res;
   XkbStateRec state;
   int increment = atoi(argv[1]);
   
   dpy = XOpenDisplay(NULL);
   if (!dpy) {printf("Can't open display\n"); exit(1);}

   res = XkbQueryExtension(dpy, NULL, NULL, NULL, NULL, NULL);
   if (!res) {printf("Can't init XKB\n"); exit(1);}

   XkbGetState(dpy, XkbUseCoreKbd, &state);
   XkbLockGroup(dpy, XkbUseCoreKbd, state.group + increment);
   
   XCloseDisplay(dpy);
}

-- 
 Ivan U. Pascal         |   e-mail: [EMAIL PROTECTED]
   Administrator of     |   Tomsk State University
     University Network |       Tomsk, Russia
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel
  • Xkb sasoiliev_trash
    • Ivan Pascal

Reply via email to