Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
b7c389b9
Unverified
Commit
b7c389b9
authored
Mar 19, 2017
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/ignore_caps' into 3.6.x
Attributes GH PR #398:
https://github.com/ArcticaProject/nx-libs/pull/398
parents
7fd5d934
7065e0bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
3 deletions
+32
-3
Keyboard.c
nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+19
-3
Keyboard.h
nx-X11/programs/Xserver/hw/nxagent/Keyboard.h
+3
-0
Keystroke.c
nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
+10
-0
No files found.
nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
View file @
b7c389b9
...
...
@@ -204,8 +204,10 @@ static char *nxagentXkbGetRules(void);
unsigned
int
nxagentAltMetaMask
;
unsigned
int
nxagentAltMask
;
unsigned
int
nxagentMetaMask
;
unsigned
int
nxagentCapsMask
;
unsigned
int
nxagentNumlockMask
;
static
void
nxagentCheck
AltMetaKey
s
(
CARD8
,
int
);
static
void
nxagentCheck
ModifierMask
s
(
CARD8
,
int
);
CARD8
nxagentCapsLockKeycode
=
66
;
CARD8
nxagentNumLockKeycode
=
77
;
...
...
@@ -792,6 +794,8 @@ N/A
nxagentAltMetaMask
=
0
;
nxagentAltMask
=
0
;
nxagentMetaMask
=
0
;
nxagentCapsMask
=
0
;
nxagentNumlockMask
=
0
;
for
(
i
=
0
;
i
<
256
;
i
++
)
modmap
[
i
]
=
0
;
...
...
@@ -805,7 +809,7 @@ N/A
if
(
keycode
>
0
)
{
nxagentCheck
AltMetaKey
s
(
keycode
,
j
);
nxagentCheck
ModifierMask
s
(
keycode
,
j
);
}
}
XFreeModifiermap
(
modifier_keymap
);
...
...
@@ -1377,7 +1381,7 @@ int nxagentResetKeyboard(void)
}
}
void
nxagentCheck
AltMetaKey
s
(
CARD8
keycode
,
int
j
)
void
nxagentCheck
ModifierMask
s
(
CARD8
keycode
,
int
j
)
{
if
(
keycode
==
XKeysymToKeycode
(
nxagentDisplay
,
XK_Meta_L
))
{
...
...
@@ -1402,6 +1406,18 @@ void nxagentCheckAltMetaKeys(CARD8 keycode, int j)
nxagentAltMetaMask
|=
1
<<
j
;
nxagentAltMask
|=
1
<<
j
;
}
if
(
keycode
==
XKeysymToKeycode
(
nxagentDisplay
,
XK_Num_Lock
))
{
nxagentNumlockMask
|=
1
<<
j
;
}
if
(
keycode
==
XKeysymToKeycode
(
nxagentDisplay
,
XK_Caps_Lock
)
||
keycode
==
XKeysymToKeycode
(
nxagentDisplay
,
XK_Shift_Lock
)
)
{
nxagentCapsMask
|=
1
<<
j
;
}
}
void
nxagentCheckRemoteKeycodes
()
...
...
nx-X11/programs/Xserver/hw/nxagent/Keyboard.h
View file @
b7c389b9
...
...
@@ -126,4 +126,7 @@ CARD8 nxagentConvertKeycode(CARD8 k);
extern
CARD8
nxagentCapsLockKeycode
;
extern
CARD8
nxagentNumLockKeycode
;
extern
unsigned
int
nxagentCapsMask
;
extern
unsigned
int
nxagentNumlockMask
;
#endif
/* __Keyboard_H__ */
nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
View file @
b7c389b9
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment