diff options
author | phintuka <phintuka> | 2010-09-24 12:51:14 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2010-09-24 12:51:14 +0000 |
commit | 7f2619b2602fe927a8a1b72a54766b5e1cc5c02d (patch) | |
tree | 51e55b00f697ccff96bbca24b8be9b5232d4fc9b | |
parent | 289b33b2de6b59b6fe92192a55297cbbdfd70d6b (diff) | |
download | xineliboutput-7f2619b2602fe927a8a1b72a54766b5e1cc5c02d.tar.gz xineliboutput-7f2619b2602fe927a8a1b72a54766b5e1cc5c02d.tar.bz2 |
Cosmetics
-rw-r--r-- | xine_sxfe_frontend.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c index 767dc873..c8fa1a68 100644 --- a/xine_sxfe_frontend.c +++ b/xine_sxfe_frontend.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_sxfe_frontend.c,v 1.141 2010-09-24 12:45:44 phintuka Exp $ + * $Id: xine_sxfe_frontend.c,v 1.142 2010-09-24 12:51:14 phintuka Exp $ * */ @@ -1558,11 +1558,14 @@ static void XKeyEvent_handler(sxfe_t *this, XKeyEvent *kev) const char *fe_event = NULL; const char *ks_name; + /* resolve key symbol */ XLockDisplay (this->display); XLookupString(kev, buffer, sizeof(buffer), &ks, &status); ks_name = XKeysymToString(ks); XUnlockDisplay (this->display); + /* hotkeys */ + switch(ks) { case XK_f: case XK_F: @@ -1585,23 +1588,30 @@ static void XKeyEvent_handler(sxfe_t *this, XKeyEvent *kev) break; default:; } - if (fe_event) + + if (fe_event) { this->x.fe.send_event((frontend_t*)this, fe_event); - else if (!this->no_x_kbd) { - if (ks_name) { - if (kev->state & (Mod1Mask|ControlMask)) { + return; + } + + /* send key event to VDR */ + + if (!this->no_x_kbd && ks_name) { + + /* check for key modifiers (Alt/Ctrl) */ char keyname[40] = ""; - if (kev->state & Mod1Mask) { - strcat(keyname, "Alt+"); - } - if (kev->state & ControlMask) { - strcat(keyname, "Ctrl+"); - } - strncat(keyname, ks_name, sizeof(keyname) - 11); - ks_name = keyname; + if (kev->state & (Mod1Mask|ControlMask)) { + if (kev->state & Mod1Mask) { + strcat(keyname, "Alt+"); } - this->x.fe.send_input_event((frontend_t*)this, "XKeySym", ks_name, 0, 0); + if (kev->state & ControlMask) { + strcat(keyname, "Ctrl+"); + } + strncat(keyname, ks_name, sizeof(keyname) - 11); + ks_name = keyname; } + + this->x.fe.send_input_event((frontend_t*)this, "XKeySym", ks_name, 0, 0); } } } |