aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-03-27 22:58:38 +0200
committerUlrich Sibiller <uli42@gmx.de>2017-04-03 21:28:11 +0200
commitee18cd43d873bc814ca40faabd29cc486061969f (patch)
treec54c8522db340ff5984483a7530011a7bb23c079
parentd28cf55743a5acadd0fa650a5559083c210449b8 (diff)
downloadnx-libs-ee18cd43d873bc814ca40faabd29cc486061969f.tar.gz
nx-libs-ee18cd43d873bc814ca40faabd29cc486061969f.tar.bz2
nx-libs-ee18cd43d873bc814ca40faabd29cc486061969f.zip
Keystrokes: rename left/up/right/down keystrokes to descriptive names
The are now called reflecting their purpose: viewport_scroll_left/up/right/down. This also regroups all the keystrokes referring to viewport stuff.
-rw-r--r--doc/nxagent/README.keystrokes13
-rw-r--r--etc/keystrokes.cfg18
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Events.c8
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keystroke.c78
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keystroke.h11
5 files changed, 64 insertions, 64 deletions
diff --git a/doc/nxagent/README.keystrokes b/doc/nxagent/README.keystrokes
index 612e710cc..3d55f5096 100644
--- a/doc/nxagent/README.keystrokes
+++ b/doc/nxagent/README.keystrokes
@@ -90,13 +90,12 @@ resize
mode. In viewport mode the xserver screen size stays static even
if the nxagent window is resized. You will possibly only see a part of
the screen and can scroll around using the following actions:
-viewport_move_up/down
- Moves the viewport up/down by the height of the visiable area.
-viewport_move_left/right
- Moves the viewport left/right by the width of the visible area.
-up/down/left/right
- Smoothly moves the viewport up/down/left/right with increasing step
- size (maximum step size is 200px).
+viewport_move_left/up/right/down
+ Moves the viewport left/up/right/down by the width resp. height of
+ the visible area.
+viewport_scroll_left/up/right/down
+ Scrolls the viewport left/up/right/down with increasing speed
+ (maximum step size is 200px).
defer
Activates/deactivates deferred screen updates.
diff --git a/etc/keystrokes.cfg b/etc/keystrokes.cfg
index 1620e04d0..b482119ad 100644
--- a/etc/keystrokes.cfg
+++ b/etc/keystrokes.cfg
@@ -4,10 +4,10 @@
<keystroke action="switch_all_screens" Control="1" AltMeta="1" key="f" />
<keystroke action="fullscreen" Control="1" Shift="1" AltMeta="1" key="f" />
<keystroke action="minimize" Control="1" AltMeta="1" key="m" />
-<keystroke action="resize" Control="1" AltMeta="1" key="r" />
<keystroke action="defer" Control="1" AltMeta="1" key="e" />
<keystroke action="ignore" Control="1" AltMeta="1" key="BackSpace" />
<keystroke action="force_synchronization" Control="1" AltMeta="1" key="j" />
+<keystroke action="resize" Control="1" AltMeta="1" key="r" />
<keystroke action="viewport_move_left" Control="1" Shift="1" AltMeta="1" key="Left" />
<keystroke action="viewport_move_left" Control="1" Shift="1" AltMeta="1" key="KP_Left" />
<keystroke action="viewport_move_up" Control="1" AltMeta="1" key="Up" />
@@ -16,13 +16,13 @@
<keystroke action="viewport_move_right" Control="1" AltMeta="1" key="KP_Right" />
<keystroke action="viewport_move_down" Control="1" AltMeta="1" key="Down" />
<keystroke action="viewport_move_down" Control="1" AltMeta="1" key="KP_Down" />
-<keystroke action="left" Control="1" AltMeta="1" key="Left" />
-<keystroke action="left" Control="1" AltMeta="1" key="KP_Left" />
-<keystroke action="up" Control="1" AltMeta="1" key="Up" />
-<keystroke action="up" Control="1" AltMeta="1" key="KP_Up" />
-<keystroke action="right" Control="1" AltMeta="1" key="Right" />
-<keystroke action="right" Control="1" AltMeta="1" key="KP_Right" />
-<keystroke action="down" Control="1" AltMeta="1" key="Down" />
-<keystroke action="down" Control="1" AltMeta="1" key="KP_Down" />
+<keystroke action="viewport_scroll_left" Control="1" AltMeta="1" key="Left" />
+<keystroke action="viewport_scroll_left" Control="1" AltMeta="1" key="KP_Left" />
+<keystroke action="viewport_scroll_up" Control="1" AltMeta="1" key="Up" />
+<keystroke action="viewport_scroll_up" Control="1" AltMeta="1" key="KP_Up" />
+<keystroke action="viewport_scroll_right" Control="1" AltMeta="1" key="Right" />
+<keystroke action="viewport_scroll_right" Control="1" AltMeta="1" key="KP_Right" />
+<keystroke action="viewport_scroll_down" Control="1" AltMeta="1" key="Down" />
+<keystroke action="viewport_scroll_down" Control="1" AltMeta="1" key="KP_Down" />
<keystroke action="reread_keystrokes" Control="1" AltMeta="1" key="k" />
</keystrokes>
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index d8512b548..e4d031e06 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -180,6 +180,10 @@ static int viewportLastX;
static int viewportLastY;
static Cursor viewportCursor;
+#define MAX_INC 200
+#define INC_STEP 5
+#define nextinc(x) ((x) < MAX_INC ? (x) += INC_STEP : (x))
+
/*
* Keyboard and pointer are handled as they were real devices by
* Xnest and we inherit this behaviour. The following mask will
@@ -193,10 +197,6 @@ static Mask defaultEventMask;
static int lastEventSerial = 0;
-#define MAX_INC 200
-#define INC_STEP 5
-#define nextinc(x) ((x) < MAX_INC ? (x) += INC_STEP : (x))
-
/*
* Used to mask the appropriate bits in
* the state reported by XkbStateNotify
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
index ff6a2939e..ef7b0b27f 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
@@ -75,11 +75,6 @@ char * nxagentSpecialKeystrokeNames[] = {
"switch_all_screens",
"fullscreen",
"minimize",
- "left",
- "up",
- "right",
- "down",
- "resize",
"defer",
"ignore",
"force_synchronization",
@@ -94,10 +89,15 @@ char * nxagentSpecialKeystrokeNames[] = {
"test_input",
"deactivate_input_devices_grab",
#endif
+ "resize",
"viewport_move_left",
"viewport_move_up",
"viewport_move_right",
"viewport_move_down",
+ "viewport_scroll_left",
+ "viewport_scroll_up",
+ "viewport_scroll_right",
+ "viewport_scroll_down",
"reread_keystrokes",
NULL,
@@ -112,15 +112,6 @@ struct nxagentSpecialKeystrokeMap default_map[] = {
{KEYSTROKE_SWITCH_ALL_SCREENS, ControlMask, True, XK_f},
{KEYSTROKE_FULLSCREEN, ControlMask | ShiftMask, True, XK_f},
{KEYSTROKE_MINIMIZE, ControlMask, True, XK_m},
- {KEYSTROKE_LEFT, ControlMask, True, XK_Left},
- {KEYSTROKE_LEFT, ControlMask, True, XK_KP_Left},
- {KEYSTROKE_UP, ControlMask, True, XK_Up},
- {KEYSTROKE_UP, ControlMask, True, XK_KP_Up},
- {KEYSTROKE_RIGHT, ControlMask, True, XK_Right},
- {KEYSTROKE_RIGHT, ControlMask, True, XK_KP_Right},
- {KEYSTROKE_DOWN, ControlMask, True, XK_Down},
- {KEYSTROKE_DOWN, ControlMask, True, XK_KP_Down},
- {KEYSTROKE_RESIZE, ControlMask, True, XK_r},
{KEYSTROKE_DEFER, ControlMask, True, XK_e},
{KEYSTROKE_IGNORE, ControlMask, True, XK_BackSpace},
{KEYSTROKE_IGNORE, 0, False, XK_Terminate_Server},
@@ -132,6 +123,7 @@ struct nxagentSpecialKeystrokeMap default_map[] = {
{KEYSTROKE_TEST_INPUT, ControlMask, True, XK_x},
{KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB, ControlMask, True, XK_y},
#endif
+ {KEYSTROKE_RESIZE, ControlMask, True, XK_r},
{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},
@@ -140,6 +132,14 @@ struct nxagentSpecialKeystrokeMap default_map[] = {
{KEYSTROKE_VIEWPORT_MOVE_RIGHT, ControlMask | ShiftMask, True, XK_KP_Right},
{KEYSTROKE_VIEWPORT_MOVE_DOWN, ControlMask | ShiftMask, True, XK_Down},
{KEYSTROKE_VIEWPORT_MOVE_DOWN, ControlMask | ShiftMask, True, XK_KP_Down},
+ {KEYSTROKE_VIEWPORT_SCROLL_LEFT, ControlMask, True, XK_Left},
+ {KEYSTROKE_VIEWPORT_SCROLL_LEFT, ControlMask, True, XK_KP_Left},
+ {KEYSTROKE_VIEWPORT_SCROLL_UP, ControlMask, True, XK_Up},
+ {KEYSTROKE_VIEWPORT_SCROLL_UP, ControlMask, True, XK_KP_Up},
+ {KEYSTROKE_VIEWPORT_SCROLL_RIGHT, ControlMask, True, XK_Right},
+ {KEYSTROKE_VIEWPORT_SCROLL_RIGHT, ControlMask, True, XK_KP_Right},
+ {KEYSTROKE_VIEWPORT_SCROLL_DOWN, ControlMask, True, XK_Down},
+ {KEYSTROKE_VIEWPORT_SCROLL_DOWN, ControlMask, True, XK_KP_Down},
{KEYSTROKE_REREAD_KEYSTROKES, ControlMask, True, XK_k},
{KEYSTROKE_END_MARKER, 0, False, NoSymbol},
};
@@ -559,31 +559,6 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
*result = doMinimize;
}
break;
- case KEYSTROKE_LEFT:
- if (!nxagentOption(Rootless) && !nxagentOption(DesktopResize)) {
- *result = doViewportLeft;
- }
- break;
- case KEYSTROKE_UP:
- if (!nxagentOption(Rootless) && !nxagentOption(DesktopResize)) {
- *result = doViewportUp;
- }
- break;
- case KEYSTROKE_RIGHT:
- if (!nxagentOption(Rootless) && !nxagentOption(DesktopResize)) {
- *result = doViewportRight;
- }
- break;
- case KEYSTROKE_DOWN:
- if (!nxagentOption(Rootless) && !nxagentOption(DesktopResize)) {
- *result = doViewportDown;
- }
- break;
- case KEYSTROKE_RESIZE:
- if (!nxagentOption(Rootless)) {
- *result = doSwitchResizeMode;
- }
- break;
case KEYSTROKE_DEFER:
*result = doSwitchDeferMode;
break;
@@ -628,6 +603,11 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
*result = doSwitchFullscreen;
}
break;
+ case KEYSTROKE_RESIZE:
+ if (!nxagentOption(Rootless)) {
+ *result = doSwitchResizeMode;
+ }
+ break;
case KEYSTROKE_VIEWPORT_MOVE_LEFT:
if (!nxagentOption(Rootless) && !nxagentOption(DesktopResize)) {
*result = doViewportMoveLeft;
@@ -648,6 +628,26 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
*result = doViewportMoveDown;
}
break;
+ case KEYSTROKE_VIEWPORT_SCROLL_LEFT:
+ if (!nxagentOption(Rootless) && !nxagentOption(DesktopResize)) {
+ *result = doViewportLeft;
+ }
+ break;
+ case KEYSTROKE_VIEWPORT_SCROLL_UP:
+ if (!nxagentOption(Rootless) && !nxagentOption(DesktopResize)) {
+ *result = doViewportUp;
+ }
+ break;
+ case KEYSTROKE_VIEWPORT_SCROLL_RIGHT:
+ if (!nxagentOption(Rootless) && !nxagentOption(DesktopResize)) {
+ *result = doViewportRight;
+ }
+ break;
+ case KEYSTROKE_VIEWPORT_SCROLL_DOWN:
+ if (!nxagentOption(Rootless) && !nxagentOption(DesktopResize)) {
+ *result = doViewportDown;
+ }
+ break;
case KEYSTROKE_REREAD_KEYSTROKES:
/* two reasons to check on KeyRelease:
- this code is called for KeyPress and KeyRelease, so we
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h
index 7eb71bb6f..13a83d0fe 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h
@@ -44,11 +44,6 @@ enum nxagentSpecialKeystroke {
KEYSTROKE_SWITCH_ALL_SCREENS,
KEYSTROKE_FULLSCREEN,
KEYSTROKE_MINIMIZE,
- KEYSTROKE_LEFT,
- KEYSTROKE_UP,
- KEYSTROKE_RIGHT,
- KEYSTROKE_DOWN,
- KEYSTROKE_RESIZE,
KEYSTROKE_DEFER,
KEYSTROKE_IGNORE,
KEYSTROKE_FORCE_SYNCHRONIZATION,
@@ -65,10 +60,16 @@ enum nxagentSpecialKeystroke {
KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB,
#endif
+ /* all the viewport stuff */
+ KEYSTROKE_RESIZE,
KEYSTROKE_VIEWPORT_MOVE_LEFT,
KEYSTROKE_VIEWPORT_MOVE_UP,
KEYSTROKE_VIEWPORT_MOVE_RIGHT,
KEYSTROKE_VIEWPORT_MOVE_DOWN,
+ KEYSTROKE_VIEWPORT_SCROLL_LEFT,
+ KEYSTROKE_VIEWPORT_SCROLL_UP,
+ KEYSTROKE_VIEWPORT_SCROLL_RIGHT,
+ KEYSTROKE_VIEWPORT_SCROLL_DOWN,
KEYSTROKE_REREAD_KEYSTROKES,