diff options
author | Pierre Ossman <ossman@cendio.se> | 2013-05-30 14:48:20 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2013-05-30 14:48:20 +0000 |
commit | 442e97152d23f5c017a14b4db9642bd27ce46ca2 (patch) | |
tree | 737d09a11f10ab3afe31c564f2c5dfe0bac788b2 | |
parent | 0da2f1fd991cf05c046165b4c1fe425388d9f2ec (diff) | |
download | tigervnc-442e97152d23f5c017a14b4db9642bd27ce46ca2.tar.gz tigervnc-442e97152d23f5c017a14b4db9642bd27ce46ca2.zip |
Simplify the lookup of alternative keysyms.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5118 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | unix/xserver/hw/vnc/Input.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/unix/xserver/hw/vnc/Input.cc b/unix/xserver/hw/vnc/Input.cc index 5f96f380..83f2ef3e 100644 --- a/unix/xserver/hw/vnc/Input.cc +++ b/unix/xserver/hw/vnc/Input.cc @@ -475,18 +475,18 @@ void InputDevice::keyEvent(rdr::U32 keysym, bool down) /* Try some equivalent keysyms if we couldn't find a perfect match */ if (keycode == 0) { for (i = 0;i < sizeof(altKeysym)/sizeof(altKeysym[0]);i++) { - if (altKeysym[i].a == keysym) { - keycode = keysymToKeycode(altKeysym[i].b, - state, &new_state); - if (keycode != 0) - break; - } - if (altKeysym[i].b == keysym) { - keycode = keysymToKeycode(altKeysym[i].a, - state, &new_state); - if (keycode != 0) - break; - } + KeySym altsym; + + if (altKeysym[i].a == keysym) + altsym = altKeysym[i].b; + else if (altKeysym[i].b == keysym) + altsym = altKeysym[i].a; + else + continue; + + keycode = keysymToKeycode(altsym, state, &new_state); + if (keycode != 0) + break; } } |