summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSibbi <>2013-01-25 16:52:23 +0100
committerJohns <johns98@gmx.net>2013-01-25 16:52:23 +0100
commit2733e47af7d8f2e7a9f28594bc09f72b224ba813 (patch)
treec633e903c86e029fd8feeac6fe3cf000cd0b3663
parentf9998e7664aa1ceab872221c4bc65966fa23f0b9 (diff)
downloadvdr-plugin-softhddevice-2733e47af7d8f2e7a9f28594bc09f72b224ba813.tar.gz
vdr-plugin-softhddevice-2733e47af7d8f2e7a9f28594bc09f72b224ba813.tar.bz2
Add modifiers to X11 remote key names.
-rw-r--r--video.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/video.c b/video.c
index 8df0e78..ef83fb0 100644
--- a/video.c
+++ b/video.c
@@ -9302,7 +9302,8 @@ static void VideoEvent(void)
{
XEvent event;
KeySym keysym;
- char buf[32];
+ const char *keynam;
+ char buf[64];
uint32_t values[1];
XNextEvent(XlibDisplay, &event);
@@ -9343,7 +9344,21 @@ static void VideoEvent(void)
event.xkey.keycode);
break;
}
- FeedKeyPress("XKeySym", XKeysymToString(keysym), 0, 0);
+ keynam = XKeysymToString(keysym);
+ // check for key modifiers (Alt/Ctrl)
+ if (event.xkey.state & (Mod1Mask | ControlMask)) {
+ if (event.xkey.state & Mod1Mask) {
+ strcpy(buf, "Alt+");
+ } else {
+ buf[0] = '\0';
+ }
+ if (event.xkey.state & ControlMask) {
+ strcat(buf, "Ctrl+");
+ }
+ strncat(buf, keynam, sizeof(buf) - 10);
+ keynam = buf;
+ }
+ FeedKeyPress("XKeySym", keynam, 0, 0);
break;
case KeyRelease:
break;