This is based on a patch from Finn (at earthling.net):

"If my keymap is set to US and I use fakekey_press_keysym to send a Ó
the character isn't already in my keymap so fakekey adds it but then
sends ó instead. My patch now does the same check if a shift modifier
is required that's done in the code path for keys that are already in
the keymap."

Signed-off-by: Jussi Kukkonen <jussi.kukko...@intel.com>
---
 src/libfakekey.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/libfakekey.c b/src/libfakekey.c
index df650a4..edf3006 100644
--- a/src/libfakekey.c
+++ b/src/libfakekey.c
@@ -357,7 +357,16 @@ fakekey_press_keysym(FakeKey *fk,
        * 
        * Probably better to try and grab the mapping notify *here* ?
        */
-  
+
+      if (XKeycodeToKeysym(fk->xdpy, code, 0) != keysym)
+        {
+          DBG("does not equal code for index 0, needs shift?\n");
+          /* TODO: Assumes 1st modifier is shifted  */
+          if (XKeycodeToKeysym(fk->xdpy, code, 1) == keysym)
+            flags |= FAKEKEYMOD_SHIFT;         /* can get at it via shift */
+          else
+            DBG("attempted to add keycode to keymap but seem to have failed");
+        }
     }
 
   if (code != 0) 
-- 
2.11.0

-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to