Commit 2b9d7d27 authored by Ulrich Sibiller's avatar Ulrich Sibiller

Keystroke.c: use Booleans where appropriate

Some of the keystroke checks have used them before. This commit unifies those checks.
parent 076d458e
...@@ -48,7 +48,7 @@ extern Bool nxagentIpaq; ...@@ -48,7 +48,7 @@ extern Bool nxagentIpaq;
extern char *nxagentKeystrokeFile; extern char *nxagentKeystrokeFile;
#ifdef NX_DEBUG_INPUT #ifdef NX_DEBUG_INPUT
int nxagentDebugInputDevices = 0; int nxagentDebugInputDevices = False;
unsigned long nxagentLastInputDevicesDumpTime = 0; unsigned long nxagentLastInputDevicesDumpTime = 0;
extern void nxagentDeactivateInputDevicesGrabs(); extern void nxagentDeactivateInputDevicesGrabs();
#endif #endif
...@@ -618,12 +618,12 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) ...@@ -618,12 +618,12 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
* Used to test the input devices state. * Used to test the input devices state.
*/ */
if (X -> type == KeyPress) { if (X -> type == KeyPress) {
if (nxagentDebugInputDevices == 0) { if (nxagentDebugInputDevices == False) {
fprintf(stderr, "Info: Turning input devices debug ON.\n"); fprintf(stderr, "Info: Turning input devices debug ON.\n");
nxagentDebugInputDevices = 1; nxagentDebugInputDevices = True;
} else { } else {
fprintf(stderr, "Info: Turning input devices debug OFF.\n"); fprintf(stderr, "Info: Turning input devices debug OFF.\n");
nxagentDebugInputDevices = 0; nxagentDebugInputDevices = False;
nxagentLastInputDevicesDumpTime = 0; nxagentLastInputDevicesDumpTime = 0;
} }
} }
...@@ -637,31 +637,31 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) ...@@ -637,31 +637,31 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
break; break;
#endif #endif
case KEYSTROKE_FULLSCREEN: case KEYSTROKE_FULLSCREEN:
if (nxagentOption(Rootless) == 0) { if (nxagentOption(Rootless) == False) {
*result = doSwitchFullscreen; *result = doSwitchFullscreen;
} }
break; break;
case KEYSTROKE_VIEWPORT_MOVE_LEFT: case KEYSTROKE_VIEWPORT_MOVE_LEFT:
if (nxagentOption(Rootless) == 0 && if (nxagentOption(Rootless) == False &&
nxagentOption(DesktopResize) == 0) { nxagentOption(DesktopResize) == False) {
*result = doViewportMoveLeft; *result = doViewportMoveLeft;
} }
break; break;
case KEYSTROKE_VIEWPORT_MOVE_UP: case KEYSTROKE_VIEWPORT_MOVE_UP:
if (nxagentOption(Rootless) == 0 && if (nxagentOption(Rootless) == False &&
nxagentOption(DesktopResize) == 0) { nxagentOption(DesktopResize) == False) {
*result = doViewportMoveUp; *result = doViewportMoveUp;
} }
break; break;
case KEYSTROKE_VIEWPORT_MOVE_RIGHT: case KEYSTROKE_VIEWPORT_MOVE_RIGHT:
if (nxagentOption(Rootless) == 0 && if (nxagentOption(Rootless) == False &&
nxagentOption(DesktopResize) == 0) { nxagentOption(DesktopResize) == False) {
*result = doViewportMoveRight; *result = doViewportMoveRight;
} }
break; break;
case KEYSTROKE_VIEWPORT_MOVE_DOWN: case KEYSTROKE_VIEWPORT_MOVE_DOWN:
if (nxagentOption(Rootless) == 0 && if (nxagentOption(Rootless) == False &&
nxagentOption(DesktopResize) == 0) { nxagentOption(DesktopResize) == False) {
*result = doViewportMoveDown; *result = doViewportMoveDown;
} }
break; break;
......
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