[at-spi2-core: 1/2] deviceeventcontroller-x11.c: Also try mod4 and mod5 to generate keysyms



commit 4bb28307d659b583b34fadc0ce5a9290a59861a5
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Sat Jun 8 01:49:36 2019 +0200

    deviceeventcontroller-x11.c: Also try mod4 and mod5 to generate keysyms
    
    Notably azerty's altgr modifier is mapped on mod5, so we need to try it too
    to get more than half of the non-alphabetic characters.

 registryd/deviceeventcontroller-x11.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
---
diff --git a/registryd/deviceeventcontroller-x11.c b/registryd/deviceeventcontroller-x11.c
index e5b8dfc..6618ea1 100644
--- a/registryd/deviceeventcontroller-x11.c
+++ b/registryd/deviceeventcontroller-x11.c
@@ -140,6 +140,14 @@ keysym_mod_mask (KeySym keysym, KeyCode keycode)
                 (sym_rtn == keysym)) {
                retval = Mod3Mask;
        }
+       else if (XkbLookupKeySym (display, keycode, Mod4Mask, &mods_rtn, &sym_rtn) &&
+                (sym_rtn == keysym)) {
+               retval = Mod4Mask;
+       }
+       else if (XkbLookupKeySym (display, keycode, Mod5Mask, &mods_rtn, &sym_rtn) &&
+                (sym_rtn == keysym)) {
+               retval = Mod5Mask;
+       }
        else if (XkbLookupKeySym (display, keycode, 
                                  ShiftMask | Mod2Mask, &mods_rtn, &sym_rtn) &&
                 (sym_rtn == keysym)) {
@@ -155,6 +163,11 @@ keysym_mod_mask (KeySym keysym, KeyCode keycode)
                 (sym_rtn == keysym)) {
                retval = (Mod4Mask | ShiftMask);
        }
+       else if (XkbLookupKeySym (display, keycode,
+                                 ShiftMask | Mod5Mask, &mods_rtn, &sym_rtn) &&
+                (sym_rtn == keysym)) {
+               retval = (Mod5Mask | ShiftMask);
+       }
        else
                retval = 0xFFFF;
        return retval;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]