tweaks: renumber a couple of symbols, and reshuffle a bit of code

Also, contract the regex for key strings.
master
Benno Schulenberg 2018-11-07 19:30:04 +01:00
parent f55a3fabef
commit e938c24d04
3 changed files with 11 additions and 11 deletions

View File

@ -582,19 +582,19 @@ enum
#define CONTROL_DOWN 0x404
#define CONTROL_HOME 0x405
#define CONTROL_END 0x406
#define CONTROL_DELETE 0x407
#define CONTROL_DELETE 0x40D
#define SHIFT_CONTROL_LEFT 0x411
#define SHIFT_CONTROL_RIGHT 0x412
#define SHIFT_CONTROL_UP 0x413
#define SHIFT_CONTROL_DOWN 0x414
#define SHIFT_CONTROL_HOME 0x415
#define SHIFT_CONTROL_END 0x416
#define CONTROL_SHIFT_DELETE 0x417
#define CONTROL_SHIFT_DELETE 0x41D
#define ALT_LEFT 0x421
#define ALT_RIGHT 0x422
#define ALT_UP 0x423
#define ALT_DOWN 0x424
#define ALT_DELETE 0x427
#define ALT_DELETE 0x42D
#define SHIFT_ALT_LEFT 0x431
#define SHIFT_ALT_RIGHT 0x432
#define SHIFT_ALT_UP 0x433

View File

@ -595,19 +595,19 @@ int parse_kbinput(WINDOW *win)
/* Modifiers are: Alt (8), Ctrl (4), Shift (1). */
if (on_a_vt && ioctl(0, TIOCLINUX, &modifiers) >= 0) {
#ifndef NANO_TINY
/* Is Delete pressed together with Shift or Shift+Ctrl? */
if (retval == KEY_DC) {
if (modifiers == 0x01)
return SHIFT_DELETE;
if (modifiers == 0x05)
return CONTROL_SHIFT_DELETE;
}
/* Is Shift being held? */
if (modifiers & 0x01) {
/* A shifted <Tab> is a back tab. */
if (retval == TAB_CODE)
return SHIFT_TAB;
shift_held = TRUE;
}
/* Is Shift being held while Delete is pressed? */
if (modifiers == 0x01 && retval == KEY_DC)
return SHIFT_DELETE;
/* Are Ctrl and Shift being held while Delete is pressed? */
if (modifiers == 0x05 && retval == KEY_DC)
return CONTROL_SHIFT_DELETE;
/* Is Alt being held? */
if (modifiers == 0x08) {
if (retval == KEY_DC)

View File

@ -5,7 +5,7 @@ syntax nanohelp
# Key combos:
color cyan "\^[]4-8A-Z^\_◀▶▲▼]" "[◀▶▲▼]" "\<M-." "\<F1?[0-9]"
color cyan "\<(Tab|Sh-Tab|Enter|Ins|Del|Sh-\^?Del|Space|Bsp|Up|Down|Left|Right|Home|End|PgUp|PgDn)\>"
color cyan "\<((Sh-)?Tab|Enter|Ins|(Sh-\^?)?Del|Space|Bsp|Up|Down|Left|Right|Home|End|PgUp|PgDn)\>"
# Quoted indicators:
color brightred "'(\^|M-)'"