more minor shortcut-related fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2244 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2005-01-08 06:16:19 +00:00
parent 35e9713543
commit f4a799aaec
2 changed files with 16 additions and 6 deletions

View File

@ -182,13 +182,21 @@ CVS code -
- Remove v_first parameter, and go back to the old behavior of - Remove v_first parameter, and go back to the old behavior of
putting back the first character of the escape sequence, as it putting back the first character of the escape sequence, as it
worked just as well and was less complicated. (DLR) worked just as well and was less complicated. (DLR)
get_mouseinput()
- Return TRUE instead of FALSE only when we have a control key,
a prinary meta key sequence, or both. (DLR)
get_shortcut() get_shortcut()
- Add a debug message. (DLR) - Add a debug message. (DLR)
- Take kbinput as a reference instead of a value, so that it's - Take kbinput as a reference instead of a value, so that it's
translated when the key is translated to its equivalent translated when the key is translated to its equivalent
control key or meta key shortcut. (DLR) control key or meta key shortcut. (DLR)
- Return s instead of NULL only when we have a control key, a
prinary meta key sequence, or both. (DLR)
get_toggle() get_toggle()
- Add a debug message. (DLR) - Add a debug message. (DLR)
bottombars()
- Initialize foo, in case a keystroke meets none of the handled
cases. (DLR)
- configure.ac: - configure.ac:
- Remove specific references to control key shortcuts. (DLR) - Remove specific references to control key shortcuts. (DLR)
- Check for the wide version of ncurses, without which multibyte - Check for the wide version of ncurses, without which multibyte

View File

@ -1639,12 +1639,13 @@ bool get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts)
/* And put back the equivalent key. Assume that each shortcut /* And put back the equivalent key. Assume that each shortcut
* has, at the very least, an equivalent control key, an * has, at the very least, an equivalent control key, an
* equivalent primary meta key sequence, or both. */ * equivalent primary meta key sequence, or both. */
if (s->ctrlval != NANO_NO_KEY) if (s->ctrlval != NANO_NO_KEY) {
unget_kbinput(s->ctrlval, FALSE, FALSE); unget_kbinput(s->ctrlval, FALSE, FALSE);
else if (s->metaval != NANO_NO_KEY) return TRUE;
} else if (s->metaval != NANO_NO_KEY) {
unget_kbinput(s->metaval, TRUE, FALSE); unget_kbinput(s->metaval, TRUE, FALSE);
return TRUE;
return TRUE; }
} }
return FALSE; return FALSE;
} }
@ -1689,12 +1690,13 @@ const shortcut *get_shortcut(const shortcut *s_list, int *kbinput, bool
*meta_key = FALSE; *meta_key = FALSE;
*func_key = FALSE; *func_key = FALSE;
*kbinput = s->ctrlval; *kbinput = s->ctrlval;
return s;
} else if (s->metaval != NANO_NO_KEY) { } else if (s->metaval != NANO_NO_KEY) {
*meta_key = TRUE; *meta_key = TRUE;
*func_key = FALSE; *func_key = FALSE;
*kbinput = s->metaval; *kbinput = s->metaval;
return s;
} }
return s;
} }
return NULL; return NULL;
@ -3020,7 +3022,7 @@ void bottombars(const shortcut *s)
keystr = _("Up"); keystr = _("Up");
else { else {
#endif #endif
char foo[4]; char foo[4] = "";
if (s->ctrlval == NANO_CONTROL_SPACE) if (s->ctrlval == NANO_CONTROL_SPACE)
strcpy(foo, "^ "); strcpy(foo, "^ ");