Commit ee18cd43 authored by Ulrich Sibiller's avatar Ulrich Sibiller

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.
parent d28cf557
...@@ -90,13 +90,12 @@ resize ...@@ -90,13 +90,12 @@ resize
mode. In viewport mode the xserver screen size stays static even 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 if the nxagent window is resized. You will possibly only see a part of
the screen and can scroll around using the following actions: the screen and can scroll around using the following actions:
viewport_move_up/down viewport_move_left/up/right/down
Moves the viewport up/down by the height of the visiable area. Moves the viewport left/up/right/down by the width resp. height of
viewport_move_left/right the visible area.
Moves the viewport left/right by the width of the visible area. viewport_scroll_left/up/right/down
up/down/left/right Scrolls the viewport left/up/right/down with increasing speed
Smoothly moves the viewport up/down/left/right with increasing step (maximum step size is 200px).
size (maximum step size is 200px).
defer defer
Activates/deactivates deferred screen updates. Activates/deactivates deferred screen updates.
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
<keystroke action="switch_all_screens" Control="1" AltMeta="1" key="f" /> <keystroke action="switch_all_screens" Control="1" AltMeta="1" key="f" />
<keystroke action="fullscreen" Control="1" Shift="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="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="defer" Control="1" AltMeta="1" key="e" />
<keystroke action="ignore" Control="1" AltMeta="1" key="BackSpace" /> <keystroke action="ignore" Control="1" AltMeta="1" key="BackSpace" />
<keystroke action="force_synchronization" Control="1" AltMeta="1" key="j" /> <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="Left" />
<keystroke action="viewport_move_left" Control="1" Shift="1" AltMeta="1" key="KP_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" /> <keystroke action="viewport_move_up" Control="1" AltMeta="1" key="Up" />
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
<keystroke action="viewport_move_right" Control="1" AltMeta="1" key="KP_Right" /> <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="Down" />
<keystroke action="viewport_move_down" Control="1" AltMeta="1" key="KP_Down" /> <keystroke action="viewport_move_down" Control="1" AltMeta="1" key="KP_Down" />
<keystroke action="left" Control="1" AltMeta="1" key="Left" /> <keystroke action="viewport_scroll_left" Control="1" AltMeta="1" key="Left" />
<keystroke action="left" Control="1" AltMeta="1" key="KP_Left" /> <keystroke action="viewport_scroll_left" Control="1" AltMeta="1" key="KP_Left" />
<keystroke action="up" Control="1" AltMeta="1" key="Up" /> <keystroke action="viewport_scroll_up" Control="1" AltMeta="1" key="Up" />
<keystroke action="up" Control="1" AltMeta="1" key="KP_Up" /> <keystroke action="viewport_scroll_up" Control="1" AltMeta="1" key="KP_Up" />
<keystroke action="right" Control="1" AltMeta="1" key="Right" /> <keystroke action="viewport_scroll_right" Control="1" AltMeta="1" key="Right" />
<keystroke action="right" Control="1" AltMeta="1" key="KP_Right" /> <keystroke action="viewport_scroll_right" Control="1" AltMeta="1" key="KP_Right" />
<keystroke action="down" Control="1" AltMeta="1" key="Down" /> <keystroke action="viewport_scroll_down" Control="1" AltMeta="1" key="Down" />
<keystroke action="down" Control="1" AltMeta="1" key="KP_Down" /> <keystroke action="viewport_scroll_down" Control="1" AltMeta="1" key="KP_Down" />
<keystroke action="reread_keystrokes" Control="1" AltMeta="1" key="k" /> <keystroke action="reread_keystrokes" Control="1" AltMeta="1" key="k" />
</keystrokes> </keystrokes>
...@@ -180,6 +180,10 @@ static int viewportLastX; ...@@ -180,6 +180,10 @@ static int viewportLastX;
static int viewportLastY; static int viewportLastY;
static Cursor viewportCursor; 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 * Keyboard and pointer are handled as they were real devices by
* Xnest and we inherit this behaviour. The following mask will * Xnest and we inherit this behaviour. The following mask will
...@@ -193,10 +197,6 @@ static Mask defaultEventMask; ...@@ -193,10 +197,6 @@ static Mask defaultEventMask;
static int lastEventSerial = 0; 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 * Used to mask the appropriate bits in
* the state reported by XkbStateNotify * the state reported by XkbStateNotify
......
...@@ -75,11 +75,6 @@ char * nxagentSpecialKeystrokeNames[] = { ...@@ -75,11 +75,6 @@ char * nxagentSpecialKeystrokeNames[] = {
"switch_all_screens", "switch_all_screens",
"fullscreen", "fullscreen",
"minimize", "minimize",
"left",
"up",
"right",
"down",
"resize",
"defer", "defer",
"ignore", "ignore",
"force_synchronization", "force_synchronization",
...@@ -94,10 +89,15 @@ char * nxagentSpecialKeystrokeNames[] = { ...@@ -94,10 +89,15 @@ char * nxagentSpecialKeystrokeNames[] = {
"test_input", "test_input",
"deactivate_input_devices_grab", "deactivate_input_devices_grab",
#endif #endif
"resize",
"viewport_move_left", "viewport_move_left",
"viewport_move_up", "viewport_move_up",
"viewport_move_right", "viewport_move_right",
"viewport_move_down", "viewport_move_down",
"viewport_scroll_left",
"viewport_scroll_up",
"viewport_scroll_right",
"viewport_scroll_down",
"reread_keystrokes", "reread_keystrokes",
NULL, NULL,
...@@ -112,15 +112,6 @@ struct nxagentSpecialKeystrokeMap default_map[] = { ...@@ -112,15 +112,6 @@ struct nxagentSpecialKeystrokeMap default_map[] = {
{KEYSTROKE_SWITCH_ALL_SCREENS, ControlMask, True, XK_f}, {KEYSTROKE_SWITCH_ALL_SCREENS, ControlMask, True, XK_f},
{KEYSTROKE_FULLSCREEN, ControlMask | ShiftMask, True, XK_f}, {KEYSTROKE_FULLSCREEN, ControlMask | ShiftMask, True, XK_f},
{KEYSTROKE_MINIMIZE, ControlMask, True, XK_m}, {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_DEFER, ControlMask, True, XK_e},
{KEYSTROKE_IGNORE, ControlMask, True, XK_BackSpace}, {KEYSTROKE_IGNORE, ControlMask, True, XK_BackSpace},
{KEYSTROKE_IGNORE, 0, False, XK_Terminate_Server}, {KEYSTROKE_IGNORE, 0, False, XK_Terminate_Server},
...@@ -132,6 +123,7 @@ struct nxagentSpecialKeystrokeMap default_map[] = { ...@@ -132,6 +123,7 @@ struct nxagentSpecialKeystrokeMap default_map[] = {
{KEYSTROKE_TEST_INPUT, ControlMask, True, XK_x}, {KEYSTROKE_TEST_INPUT, ControlMask, True, XK_x},
{KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB, ControlMask, True, XK_y}, {KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB, ControlMask, True, XK_y},
#endif #endif
{KEYSTROKE_RESIZE, ControlMask, True, XK_r},
{KEYSTROKE_VIEWPORT_MOVE_LEFT, ControlMask | ShiftMask, True, XK_Left}, {KEYSTROKE_VIEWPORT_MOVE_LEFT, ControlMask | ShiftMask, True, XK_Left},
{KEYSTROKE_VIEWPORT_MOVE_LEFT, ControlMask | ShiftMask, True, XK_KP_Left}, {KEYSTROKE_VIEWPORT_MOVE_LEFT, ControlMask | ShiftMask, True, XK_KP_Left},
{KEYSTROKE_VIEWPORT_MOVE_UP, ControlMask | ShiftMask, True, XK_Up}, {KEYSTROKE_VIEWPORT_MOVE_UP, ControlMask | ShiftMask, True, XK_Up},
...@@ -140,6 +132,14 @@ struct nxagentSpecialKeystrokeMap default_map[] = { ...@@ -140,6 +132,14 @@ struct nxagentSpecialKeystrokeMap default_map[] = {
{KEYSTROKE_VIEWPORT_MOVE_RIGHT, ControlMask | ShiftMask, True, XK_KP_Right}, {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_Down},
{KEYSTROKE_VIEWPORT_MOVE_DOWN, ControlMask | ShiftMask, True, XK_KP_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_REREAD_KEYSTROKES, ControlMask, True, XK_k},
{KEYSTROKE_END_MARKER, 0, False, NoSymbol}, {KEYSTROKE_END_MARKER, 0, False, NoSymbol},
}; };
...@@ -559,31 +559,6 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) ...@@ -559,31 +559,6 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
*result = doMinimize; *result = doMinimize;
} }
break; 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: case KEYSTROKE_DEFER:
*result = doSwitchDeferMode; *result = doSwitchDeferMode;
break; break;
...@@ -628,6 +603,11 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) ...@@ -628,6 +603,11 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
*result = doSwitchFullscreen; *result = doSwitchFullscreen;
} }
break; break;
case KEYSTROKE_RESIZE:
if (!nxagentOption(Rootless)) {
*result = doSwitchResizeMode;
}
break;
case KEYSTROKE_VIEWPORT_MOVE_LEFT: case KEYSTROKE_VIEWPORT_MOVE_LEFT:
if (!nxagentOption(Rootless) && !nxagentOption(DesktopResize)) { if (!nxagentOption(Rootless) && !nxagentOption(DesktopResize)) {
*result = doViewportMoveLeft; *result = doViewportMoveLeft;
...@@ -648,6 +628,26 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) ...@@ -648,6 +628,26 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
*result = doViewportMoveDown; *result = doViewportMoveDown;
} }
break; 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: case KEYSTROKE_REREAD_KEYSTROKES:
/* two reasons to check on KeyRelease: /* two reasons to check on KeyRelease:
- this code is called for KeyPress and KeyRelease, so we - this code is called for KeyPress and KeyRelease, so we
......
...@@ -44,11 +44,6 @@ enum nxagentSpecialKeystroke { ...@@ -44,11 +44,6 @@ enum nxagentSpecialKeystroke {
KEYSTROKE_SWITCH_ALL_SCREENS, KEYSTROKE_SWITCH_ALL_SCREENS,
KEYSTROKE_FULLSCREEN, KEYSTROKE_FULLSCREEN,
KEYSTROKE_MINIMIZE, KEYSTROKE_MINIMIZE,
KEYSTROKE_LEFT,
KEYSTROKE_UP,
KEYSTROKE_RIGHT,
KEYSTROKE_DOWN,
KEYSTROKE_RESIZE,
KEYSTROKE_DEFER, KEYSTROKE_DEFER,
KEYSTROKE_IGNORE, KEYSTROKE_IGNORE,
KEYSTROKE_FORCE_SYNCHRONIZATION, KEYSTROKE_FORCE_SYNCHRONIZATION,
...@@ -65,10 +60,16 @@ enum nxagentSpecialKeystroke { ...@@ -65,10 +60,16 @@ enum nxagentSpecialKeystroke {
KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB, KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB,
#endif #endif
/* all the viewport stuff */
KEYSTROKE_RESIZE,
KEYSTROKE_VIEWPORT_MOVE_LEFT, KEYSTROKE_VIEWPORT_MOVE_LEFT,
KEYSTROKE_VIEWPORT_MOVE_UP, KEYSTROKE_VIEWPORT_MOVE_UP,
KEYSTROKE_VIEWPORT_MOVE_RIGHT, KEYSTROKE_VIEWPORT_MOVE_RIGHT,
KEYSTROKE_VIEWPORT_MOVE_DOWN, KEYSTROKE_VIEWPORT_MOVE_DOWN,
KEYSTROKE_VIEWPORT_SCROLL_LEFT,
KEYSTROKE_VIEWPORT_SCROLL_UP,
KEYSTROKE_VIEWPORT_SCROLL_RIGHT,
KEYSTROKE_VIEWPORT_SCROLL_DOWN,
KEYSTROKE_REREAD_KEYSTROKES, KEYSTROKE_REREAD_KEYSTROKES,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment