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
3c921ccb
Commit
3c921ccb
authored
Mar 23, 2017
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keystroke.c/h: completely disable keystrokes that are not active at compile time
parent
811ce490
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
10 deletions
+27
-10
Keystroke.c
nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
+21
-10
Keystroke.h
nx-X11/programs/Xserver/hw/nxagent/Keystroke.h
+6
-0
No files found.
nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
View file @
3c921ccb
...
...
@@ -33,7 +33,6 @@
#include "Display.h"
#include "Events.h"
#include "Options.h"
#include "Keystroke.h"
#include "Keyboard.h"
#include "Drawable.h"
#include "Init.h"
/* extern int nxagentX2go */
...
...
@@ -63,6 +62,9 @@ extern void nxagentDeactivateInputDevicesGrabs();
#undef DEBUG
#undef DUMP
/* must be included _after_ DUMP */
#include "Keystroke.h"
/* this table is used to parse actions given on the command line or in the
* config file, therefore indices have to match the enum in Keystroke.h */
...
...
@@ -81,11 +83,16 @@ char * nxagentSpecialKeystrokeNames[] = {
"ignore"
,
"force_synchronization"
,
#ifdef DEBUG_TREE
"debug_tree"
,
#endif
#ifdef DUMP
"regions_on_screen"
,
#endif
#ifdef NX_DEBUG_INPUT
"test_input"
,
"deactivate_input_devices_grab"
,
#endif
"viewport_move_left"
,
"viewport_move_up"
,
"viewport_move_right"
,
...
...
@@ -97,7 +104,9 @@ char * nxagentSpecialKeystrokeNames[] = {
struct
nxagentSpecialKeystrokeMap
default_map
[]
=
{
/* stroke, modifierMask, modifierAltMeta, keysym */
#ifdef DEBUG_TREE
{
KEYSTROKE_DEBUG_TREE
,
ControlMask
,
True
,
XK_q
},
#endif
{
KEYSTROKE_CLOSE_SESSION
,
ControlMask
,
True
,
XK_t
},
{
KEYSTROKE_SWITCH_ALL_SCREENS
,
ControlMask
,
True
,
XK_f
},
{
KEYSTROKE_FULLSCREEN
,
ControlMask
|
ShiftMask
,
True
,
XK_f
},
...
...
@@ -115,9 +124,13 @@ struct nxagentSpecialKeystrokeMap default_map[] = {
{
KEYSTROKE_IGNORE
,
ControlMask
,
True
,
XK_BackSpace
},
{
KEYSTROKE_IGNORE
,
0
,
False
,
XK_Terminate_Server
},
{
KEYSTROKE_FORCE_SYNCHRONIZATION
,
ControlMask
,
True
,
XK_j
},
#ifdef DUMP
{
KEYSTROKE_REGIONS_ON_SCREEN
,
ControlMask
,
True
,
XK_a
},
#endif
#ifdef NX_DEBUG_INPUT
{
KEYSTROKE_TEST_INPUT
,
ControlMask
,
True
,
XK_x
},
{
KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB
,
ControlMask
,
True
,
XK_y
},
#endif
{
KEYSTROKE_VIEWPORT_MOVE_LEFT
,
ControlMask
|
ShiftMask
,
True
,
XK_Left
},
{
KEYSTROKE_VIEWPORT_MOVE_LEFT
,
ControlMask
|
ShiftMask
,
True
,
XK_KP_Left
},
{
KEYSTROKE_VIEWPORT_MOVE_UP
,
ControlMask
|
ShiftMask
,
True
,
XK_Up
},
...
...
@@ -494,11 +507,11 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
}
switch
(
stroke
)
{
#ifdef DEBUG_TREE
case
KEYSTROKE_DEBUG_TREE
:
#ifdef DEBUG_TREE
*
result
=
doDebugTree
;
#endif
break
;
#endif
case
KEYSTROKE_CLOSE_SESSION
:
*
result
=
doCloseSession
;
break
;
...
...
@@ -551,16 +564,16 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
case
KEYSTROKE_FORCE_SYNCHRONIZATION
:
nxagentForceSynchronization
=
1
;
break
;
#ifdef DUMP
case
KEYSTROKE_REGIONS_ON_SCREEN
:
#ifdef DUMP
nxagentRegionsOnScreen
();
#endif
break
;
#endif
#ifdef NX_DEBUG_INPUT
case
KEYSTROKE_TEST_INPUT
:
/*
* Used to test the input devices state.
*/
#ifdef NX_DEBUG_INPUT
if
(
X
->
type
==
KeyPress
)
{
if
(
nxagentDebugInputDevices
==
0
)
{
fprintf
(
stderr
,
"Info: Turning input devices debug ON.
\n
"
);
...
...
@@ -572,16 +585,14 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
}
}
return
True
;
#endif
break
;
case
KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB
:
#ifdef NX_DEBUG_INPUT
if
(
X
->
type
==
KeyPress
)
{
nxagentDeactivateInputDevicesGrab
();
}
return
True
;
#endif
break
;
#endif
case
KEYSTROKE_FULLSCREEN
:
if
(
nxagentOption
(
Rootless
)
==
0
)
{
*
result
=
doSwitchFullscreen
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Keystroke.h
View file @
3c921ccb
...
...
@@ -52,10 +52,16 @@ enum nxagentSpecialKeystroke {
KEYSTROKE_FORCE_SYNCHRONIZATION
,
/* stuff used for debugging, probably not useful for most people */
#ifdef DEBUG_TREE
KEYSTROKE_DEBUG_TREE
,
#endif
#ifdef DUMP
KEYSTROKE_REGIONS_ON_SCREEN
,
#endif
#ifdef NX_DEBUG_INPUT
KEYSTROKE_TEST_INPUT
,
KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB
,
#endif
KEYSTROKE_VIEWPORT_MOVE_LEFT
,
KEYSTROKE_VIEWPORT_MOVE_UP
,
...
...
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