input: don't return zero when some function is completely unbound
Returning a zero would mean returning a ^Space -- the keycode that by default is bound to the Next-Word function. So, unbinding the keys to which the modified Arrow keys are hard bound would cause the latter ones to mysteriously jump to the next word. This partially fixes https://savannah.gnu.org/bugs/?49058.master
parent
e2027aee15
commit
8ba57cf87b
46
src/winio.c
46
src/winio.c
|
@ -495,38 +495,38 @@ int parse_kbinput(WINDOW *win)
|
||||||
return ERR;
|
return ERR;
|
||||||
|
|
||||||
if (retval == controlleft)
|
if (retval == controlleft)
|
||||||
return sc_seq_or(do_prev_word_void, 0);
|
return sc_seq_or(do_prev_word_void, controlleft);
|
||||||
else if (retval == controlright)
|
else if (retval == controlright)
|
||||||
return sc_seq_or(do_next_word_void, 0);
|
return sc_seq_or(do_next_word_void, controlright);
|
||||||
else if (retval == controlup)
|
else if (retval == controlup)
|
||||||
return sc_seq_or(do_prev_block, 0);
|
return sc_seq_or(do_prev_block, controlup);
|
||||||
else if (retval == controldown)
|
else if (retval == controldown)
|
||||||
return sc_seq_or(do_next_block, 0);
|
return sc_seq_or(do_next_block, controldown);
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
else if (retval == shiftcontrolleft) {
|
else if (retval == shiftcontrolleft) {
|
||||||
shift_held = TRUE;
|
shift_held = TRUE;
|
||||||
return sc_seq_or(do_prev_word_void, 0);
|
return sc_seq_or(do_prev_word_void, shiftcontrolleft);
|
||||||
} else if (retval == shiftcontrolright) {
|
} else if (retval == shiftcontrolright) {
|
||||||
shift_held = TRUE;
|
shift_held = TRUE;
|
||||||
return sc_seq_or(do_next_word_void, 0);
|
return sc_seq_or(do_next_word_void, shiftcontrolright);
|
||||||
} else if (retval == shiftcontrolup) {
|
} else if (retval == shiftcontrolup) {
|
||||||
shift_held = TRUE;
|
shift_held = TRUE;
|
||||||
return sc_seq_or(do_prev_block, 0);
|
return sc_seq_or(do_prev_block, shiftcontrolup);
|
||||||
} else if (retval == shiftcontroldown) {
|
} else if (retval == shiftcontroldown) {
|
||||||
shift_held = TRUE;
|
shift_held = TRUE;
|
||||||
return sc_seq_or(do_next_block, 0);
|
return sc_seq_or(do_next_block, shiftcontroldown);
|
||||||
} else if (retval == shiftaltleft) {
|
} else if (retval == shiftaltleft) {
|
||||||
shift_held = TRUE;
|
shift_held = TRUE;
|
||||||
return sc_seq_or(do_home, 0);
|
return sc_seq_or(do_home, shiftaltleft);
|
||||||
} else if (retval == shiftaltright) {
|
} else if (retval == shiftaltright) {
|
||||||
shift_held = TRUE;
|
shift_held = TRUE;
|
||||||
return sc_seq_or(do_end, 0);
|
return sc_seq_or(do_end, shiftaltright);
|
||||||
} else if (retval == shiftaltup) {
|
} else if (retval == shiftaltup) {
|
||||||
shift_held = TRUE;
|
shift_held = TRUE;
|
||||||
return sc_seq_or(do_page_up, 0);
|
return sc_seq_or(do_page_up, shiftaltup);
|
||||||
} else if (retval == shiftaltdown) {
|
} else if (retval == shiftaltdown) {
|
||||||
shift_held = TRUE;
|
shift_held = TRUE;
|
||||||
return sc_seq_or(do_page_down, 0);
|
return sc_seq_or(do_page_down, shiftaltdown);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -539,13 +539,13 @@ int parse_kbinput(WINDOW *win)
|
||||||
/* Is Ctrl being held? */
|
/* Is Ctrl being held? */
|
||||||
if (modifiers & 0x04) {
|
if (modifiers & 0x04) {
|
||||||
if (retval == KEY_UP)
|
if (retval == KEY_UP)
|
||||||
return sc_seq_or(do_prev_block, 0);
|
return sc_seq_or(do_prev_block, controlup);
|
||||||
else if (retval == KEY_DOWN)
|
else if (retval == KEY_DOWN)
|
||||||
return sc_seq_or(do_next_block, 0);
|
return sc_seq_or(do_next_block, controldown);
|
||||||
else if (retval == KEY_LEFT)
|
else if (retval == KEY_LEFT)
|
||||||
return sc_seq_or(do_prev_word_void, 0);
|
return sc_seq_or(do_prev_word_void, controlleft);
|
||||||
else if (retval == KEY_RIGHT)
|
else if (retval == KEY_RIGHT)
|
||||||
return sc_seq_or(do_next_word_void, 0);
|
return sc_seq_or(do_next_word_void, controlright);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
|
@ -556,13 +556,13 @@ int parse_kbinput(WINDOW *win)
|
||||||
/* 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)
|
||||||
return sc_seq_or(do_page_up, 0);
|
return sc_seq_or(do_page_up, shiftaltup);
|
||||||
else if (retval == KEY_DOWN)
|
else if (retval == KEY_DOWN)
|
||||||
return sc_seq_or(do_page_down, 0);
|
return sc_seq_or(do_page_down, shiftaltdown);
|
||||||
else if (retval == KEY_LEFT)
|
else if (retval == KEY_LEFT)
|
||||||
return sc_seq_or(do_home, 0);
|
return sc_seq_or(do_home, shiftaltleft);
|
||||||
else if (retval == KEY_RIGHT)
|
else if (retval == KEY_RIGHT)
|
||||||
return sc_seq_or(do_end, 0);
|
return sc_seq_or(do_end, shiftaltright);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -633,13 +633,13 @@ int parse_kbinput(WINDOW *win)
|
||||||
#endif
|
#endif
|
||||||
case DEL_CODE:
|
case DEL_CODE:
|
||||||
if (ISSET(REBIND_DELETE))
|
if (ISSET(REBIND_DELETE))
|
||||||
return sc_seq_or(do_delete, keycode);
|
return sc_seq_or(do_delete, KEY_DC);
|
||||||
else
|
else
|
||||||
return KEY_BACKSPACE;
|
return KEY_BACKSPACE;
|
||||||
#ifdef KEY_SIC
|
#ifdef KEY_SIC
|
||||||
/* Slang doesn't support KEY_SIC. */
|
/* Slang doesn't support KEY_SIC. */
|
||||||
case KEY_SIC:
|
case KEY_SIC:
|
||||||
return sc_seq_or(do_insertfile_void, keycode);
|
return sc_seq_or(do_insertfile_void, KEY_IC);
|
||||||
#endif
|
#endif
|
||||||
#ifdef KEY_SBEG
|
#ifdef KEY_SBEG
|
||||||
/* Slang doesn't support KEY_SBEG. */
|
/* Slang doesn't support KEY_SBEG. */
|
||||||
|
@ -667,7 +667,7 @@ int parse_kbinput(WINDOW *win)
|
||||||
#endif
|
#endif
|
||||||
/* Slang doesn't support KEY_SUSPEND. */
|
/* Slang doesn't support KEY_SUSPEND. */
|
||||||
case KEY_SUSPEND:
|
case KEY_SUSPEND:
|
||||||
return sc_seq_or(do_suspend_void, 0);
|
return sc_seq_or(do_suspend_void, KEY_SUSPEND);
|
||||||
#endif
|
#endif
|
||||||
#ifdef PDCURSES
|
#ifdef PDCURSES
|
||||||
case KEY_SHIFT_L:
|
case KEY_SHIFT_L:
|
||||||
|
|
Loading…
Reference in New Issue