input: look at the modifier keys only when compiled on Linux
This fixes https://savannah.gnu.org/bugs/?48751 reported by Andrew Ho. This also fixes compilation when configured with --enable-tiny.master
parent
d8031af030
commit
928a24c204
|
@ -33,8 +33,11 @@ volatile sig_atomic_t sigwinch_counter = 0;
|
||||||
/* Is incremented by the handler whenever a SIGWINCH occurs. */
|
/* Is incremented by the handler whenever a SIGWINCH occurs. */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__linux__) && !defined(NANO_TINY)
|
||||||
bool console;
|
bool console;
|
||||||
/* Whether we're running on a Linux VC (TRUE) or under X (FALSE). */
|
/* Whether we're running on a Linux VC (TRUE) or under X (FALSE). */
|
||||||
|
#endif
|
||||||
|
|
||||||
bool meta_key;
|
bool meta_key;
|
||||||
/* Whether the current keystroke is a Meta key. */
|
/* Whether the current keystroke is a Meta key. */
|
||||||
bool focusing = TRUE;
|
bool focusing = TRUE;
|
||||||
|
|
|
@ -2482,9 +2482,10 @@ int main(int argc, char **argv)
|
||||||
/* Set up the terminal state. */
|
/* Set up the terminal state. */
|
||||||
terminal_init();
|
terminal_init();
|
||||||
|
|
||||||
|
#if defined(__linux__) && !defined(NANO_TINY)
|
||||||
/* Check whether we're running on a Linux console. */
|
/* Check whether we're running on a Linux console. */
|
||||||
console = (getenv("DISPLAY") == NULL);
|
console = (getenv("DISPLAY") == NULL);
|
||||||
|
#endif
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "Main: set up windows\n");
|
fprintf(stderr, "Main: set up windows\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -30,7 +30,10 @@
|
||||||
extern volatile sig_atomic_t sigwinch_counter;
|
extern volatile sig_atomic_t sigwinch_counter;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__linux__) && !defined(NANO_TINY)
|
||||||
extern bool console;
|
extern bool console;
|
||||||
|
#endif
|
||||||
|
|
||||||
extern bool meta_key;
|
extern bool meta_key;
|
||||||
extern bool focusing;
|
extern bool focusing;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,9 @@
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "revision.h"
|
#include "revision.h"
|
||||||
|
|
||||||
|
#if defined(__linux__) && !defined(NANO_TINY)
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
@ -504,6 +506,7 @@ int parse_kbinput(WINDOW *win)
|
||||||
return sc_seq_or(do_next_block, 0);
|
return sc_seq_or(do_next_block, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__linux__) && !defined(NANO_TINY)
|
||||||
/* When not running under X, check for the bare arrow keys whether
|
/* When not running under X, check for the bare arrow keys whether
|
||||||
* the Ctrl key is being held together with them. */
|
* the Ctrl key is being held together with them. */
|
||||||
if (console && (retval == KEY_UP || retval == KEY_DOWN ||
|
if (console && (retval == KEY_UP || retval == KEY_DOWN ||
|
||||||
|
@ -521,6 +524,7 @@ int parse_kbinput(WINDOW *win)
|
||||||
return sc_seq_or(do_next_word_void, 0);
|
return sc_seq_or(do_next_word_void, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* __linux__ && !NANO_TINY */
|
||||||
|
|
||||||
switch (retval) {
|
switch (retval) {
|
||||||
#ifdef KEY_SLEFT
|
#ifdef KEY_SLEFT
|
||||||
|
|
Loading…
Reference in New Issue