Commit db897b57 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

input: detect again when both Shift and Ctrl are being held on a VT

In nano 2.7.1 and 2.7.2, pressing Shift+Ctrl+Arrow on a Linux console
would behave as if Shift wasn't held.  It got broken three months ago,
by commit 08cd197b, messing up the proper order of the checks.

This fixes https://savannah.gnu.org/bugs/?49906.
No related merge requests found
Showing with 5 additions and 5 deletions
+5 -5
...@@ -539,6 +539,11 @@ int parse_kbinput(WINDOW *win) ...@@ -539,6 +539,11 @@ int parse_kbinput(WINDOW *win)
unsigned char modifiers = 6; unsigned char modifiers = 6;
if (console && ioctl(0, TIOCLINUX, &modifiers) >= 0) { if (console && ioctl(0, TIOCLINUX, &modifiers) >= 0) {
#ifndef NANO_TINY
/* Is Shift being held? */
if (modifiers & 0x01)
shift_held = TRUE;
#endif
/* Is Ctrl being held? */ /* Is Ctrl being held? */
if (modifiers & 0x04) { if (modifiers & 0x04) {
if (retval == KEY_UP) if (retval == KEY_UP)
...@@ -550,12 +555,7 @@ int parse_kbinput(WINDOW *win) ...@@ -550,12 +555,7 @@ int parse_kbinput(WINDOW *win)
else if (retval == KEY_RIGHT) else if (retval == KEY_RIGHT)
return sc_seq_or(do_next_word_void, controlright); return sc_seq_or(do_next_word_void, controlright);
} }
#ifndef NANO_TINY #ifndef NANO_TINY
/* Is Shift being held? */
if (modifiers & 0x01)
shift_held =TRUE;
/* Are both Shift and Alt being held? */ /* Are both Shift and Alt being held? */
if ((modifiers & 0x09) == 0x09) { if ((modifiers & 0x09) == 0x09) {
if (retval == KEY_UP) if (retval == KEY_UP)
......
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