XLib/X11 don't fire KeyPress event on upper Unicode ranges

37 Views Asked by At

Good day. For Asian languages GUI we need hundle KeyPress event type for upper Unicode ranges. For now we was able to hundle keyboard input up to 0x0600 (arabian language range) only. We test this code on different keyboard drivers XNextEvent Doesn't works for some reason This test program https://gist.github.com/javiercantero/7753445

and Luigi gui library https://github.com/nakst/luigi

Right now we use Xlib under arm64 on termux, android. All tested keyboards drivers stable fire KeyPress events for unicode ranges less than 0.x0600

//this code from Luii.h gui library we use.
XSetWindowAttributes attributes = {};
    attributes.override_redirect = flags & UI_WINDOW_MENU;

    window->window = XCreateWindow(ui.display, DefaultRootWindow(ui.display), 0, 0, width, height, 0, 0, 
        InputOutput, CopyFromParent, CWOverrideRedirect, &attributes);
    if (cTitle) XStoreName(ui.display, window->window, cTitle);
    XSelectInput(ui.display, window->window, SubstructureNotifyMask | ExposureMask | PointerMotionMask 
        | ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask | StructureNotifyMask
        | EnterWindowMask | LeaveWindowMask | ButtonMotionMask | KeymapStateMask | FocusChangeMask | PropertyChangeMask);
  
   //=====
   unsigned int keycode = XKeysymToKeycode(ui.display, XK_P);
   Bool owner_events = False;
   unsigned int modifiers = ControlMask | LockMask;
   XGrabKey(ui.display, keycode, modifiers, window->window, owner_events, GrabModeAsync, GrabModeAsync);
   //=====
   ....
   XEvent event
   XNextEvent(ui.display, &event); // - fire KeyPress up to 0x0600 
    

We checked main keyboard drivers on different version of XLib window input code examples. Right now we are not able to test on x86 computer, we tested XLib on android in different linux environment (termux, userLand) In compilled X programs (FontForge) under android XLib have the same problem - input only lower unicode range.

Any help or idea how test XLib KeyPress event for upper unicode ranges (Tibetan, Devanagary) is really appresiated.

Open Source Buddhsm Library Alexander Stroganov

0

There are 0 best solutions below