summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael BOUCHAUD <michael.bouchaud@gmail.com>2012-03-08 16:27:07 +0000
committerMichael BOUCHAUD <michael.bouchaud@gmail.com>2012-03-08 16:27:07 +0000
commit693fa9b33c4b5a1d8ae6db9d4f5c88e29db65fb5 (patch)
treed38c34d7b381203e2190117420ccf3142c24bce0
parent7821a2811dbaf7c7d5679e16157b02485b571170 (diff)
ekbd: patch from Pierre Le Magourou, add ALTGR and SHIFT modifiers to the key press event
SVN revision: 69064
-rw-r--r--src/lib/Ekbd.h.in9
-rw-r--r--src/lib/ekbd_layout.c2
2 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/Ekbd.h.in b/src/lib/Ekbd.h.in
index a280b08..01f2e60 100644
--- a/src/lib/Ekbd.h.in
+++ b/src/lib/Ekbd.h.in
@@ -34,10 +34,11 @@ typedef enum _Ekbd_Direction
34 34
35typedef enum _Ekbd_Mod 35typedef enum _Ekbd_Mod
36{ 36{
37 EKBD_MOD_SHIFT = (1 << 0), 37 EKBD_MOD_SHIFT = (1 << 0),
38 EKBD_MOD_CTRL = (1 << 1), 38 EKBD_MOD_CTRL = (1 << 1),
39 EKBD_MOD_ALT = (1 << 2), 39 EKBD_MOD_ALT = (1 << 2),
40 EKBD_MOD_WIN = (1 << 3) 40 EKBD_MOD_ALTGR = (1 << 3),
41 EKBD_MOD_WIN = (1 << 4)
41} Ekbd_Mod; 42} Ekbd_Mod;
42 43
43typedef struct _Ekbd_Event_Key_Pressed 44typedef struct _Ekbd_Event_Key_Pressed
diff --git a/src/lib/ekbd_layout.c b/src/lib/ekbd_layout.c
index 7a14b37..3c11e1d 100644
--- a/src/lib/ekbd_layout.c
+++ b/src/lib/ekbd_layout.c
@@ -1077,6 +1077,8 @@ _ekbd_layout_key_press_handle(Smart_Data *sd, Ekbd_Int_Key *ky)
1077 Ekbd_Mod mods = 0; 1077 Ekbd_Mod mods = 0;
1078 if (sd->layout.state & CTRL) mods |= EKBD_MOD_CTRL; 1078 if (sd->layout.state & CTRL) mods |= EKBD_MOD_CTRL;
1079 if (sd->layout.state & ALT) mods |= EKBD_MOD_ALT; 1079 if (sd->layout.state & ALT) mods |= EKBD_MOD_ALT;
1080 if (sd->layout.state & ALTGR) mods |= EKBD_MOD_ALTGR;
1081 if (sd->layout.state & SHIFT) mods |= EKBD_MOD_SHIFT;
1080 _ekbd_layout_send(sd->s_obj, out, mods); 1082 _ekbd_layout_send(sd->s_obj, out, mods);
1081 } 1083 }
1082 if (sd->layout.state & (SHIFT | CTRL | ALT | ALTGR)) 1084 if (sd->layout.state & (SHIFT | CTRL | ALT | ALTGR))