diff --git a/src/nano.h b/src/nano.h index 281cd75e..5261c041 100644 --- a/src/nano.h +++ b/src/nano.h @@ -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 diff --git a/src/winio.c b/src/winio.c index c1819f09..3708d1af 100644 --- a/src/winio.c +++ b/src/winio.c @@ -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 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) diff --git a/syntax/nanohelp.nanorc b/syntax/nanohelp.nanorc index fe7433f5..426b23c2 100644 --- a/syntax/nanohelp.nanorc +++ b/syntax/nanohelp.nanorc @@ -5,7 +5,7 @@ syntax nanohelp # Key combos: color cyan "\^[]4-8A-Z^\_◀▶▲▼]" "[◀▶▲▼]" "\" +color cyan "\<((Sh-)?Tab|Enter|Ins|(Sh-\^?)?Del|Space|Bsp|Up|Down|Left|Right|Home|End|PgUp|PgDn)\>" # Quoted indicators: color brightred "'(\^|M-)'"