diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2017-03-19 21:59:17 +0100 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2017-03-19 22:03:16 +0100 |
commit | 7065e0bf25484fe9cf008c934b69eff90600d3d8 (patch) | |
tree | 065ae9f127d6091ea37424f560dc8cbf47d59cc4 /nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | |
parent | 7fd5d934c1e73642e9919aa8dd5124466356fb89 (diff) | |
download | nx-libs-7065e0bf25484fe9cf008c934b69eff90600d3d8.tar.gz nx-libs-7065e0bf25484fe9cf008c934b69eff90600d3d8.tar.bz2 nx-libs-7065e0bf25484fe9cf008c934b69eff90600d3d8.zip |
Keystroke.c: ignore CapsLock and NumLock most of the time
CapsLock and NumLock will only be taken into account for keystrokes
that explicitly require them. This is implemented for convenience and
fixes ArcticaProject/nx-libs#397
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Keystroke.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c index d12b459fc..69b07dfe5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c @@ -34,6 +34,7 @@ #include "Events.h" #include "Options.h" #include "Keystroke.h" +#include "Keyboard.h" #include "Drawable.h" #include "Init.h" /* extern int nxagentX2go */ @@ -149,6 +150,15 @@ static Bool modifier_matches(unsigned int mask, int compare_alt_meta, unsigned i state &= ~nxagentAltMetaMask; } + /* ignore CapsLock and/or Numlock if the keystroke does not + explicitly require them */ + + if ( !(mask & nxagentCapsMask) ) + state &= ~nxagentCapsMask; + + if ( !(mask & nxagentNumlockMask) ) + state &= ~nxagentNumlockMask; + /* all modifiers except meta/alt have to match exactly, extra bits are evil */ if (mask != state) { ret = False; |