diff options
author | Sibbi <> | 2013-01-25 16:52:23 +0100 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2013-01-25 16:52:23 +0100 |
commit | 2733e47af7d8f2e7a9f28594bc09f72b224ba813 (patch) | |
tree | c633e903c86e029fd8feeac6fe3cf000cd0b3663 | |
parent | f9998e7664aa1ceab872221c4bc65966fa23f0b9 (diff) | |
download | vdr-plugin-softhddevice-2733e47af7d8f2e7a9f28594bc09f72b224ba813.tar.gz vdr-plugin-softhddevice-2733e47af7d8f2e7a9f28594bc09f72b224ba813.tar.bz2 |
Add modifiers to X11 remote key names.
-rw-r--r-- | video.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -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; |