2010-08-23 09:34:46 +02:00
|
|
|
http://www.midnight-commander.org/ticket/287
|
2014-01-01 23:05:39 +01:00
|
|
|
---
|
|
|
|
lib/tty/key.c | 17 +++++++++++++++--
|
|
|
|
lib/tty/tty-slang.h | 1 +
|
|
|
|
2 files changed, 16 insertions(+), 2 deletions(-)
|
|
|
|
|
2019-08-01 15:36:12 +02:00
|
|
|
Index: mc-4.8.23/lib/tty/key.c
|
2014-01-01 23:05:39 +01:00
|
|
|
===================================================================
|
2019-08-01 15:36:12 +02:00
|
|
|
--- mc-4.8.23.orig/lib/tty/key.c
|
|
|
|
+++ mc-4.8.23/lib/tty/key.c
|
|
|
|
@@ -1050,10 +1050,13 @@ correct_key_code (int code)
|
2014-01-01 23:05:39 +01:00
|
|
|
mod = KEY_M_SHIFT;
|
2010-08-23 09:34:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
- /* F0 is the same as F10 for out purposes */
|
|
|
|
+ /* F0 is the same as F10 for our purposes */
|
|
|
|
if (c == KEY_F (0))
|
|
|
|
c = KEY_F (10);
|
|
|
|
|
|
|
|
+ if (c == KEY_F_IMMUTABLE (0))
|
|
|
|
+ c = KEY_F_IMMUTABLE (10);
|
|
|
|
+
|
|
|
|
/*
|
|
|
|
* We are not interested if Ctrl was pressed when entering control
|
|
|
|
* characters, so assume that it was. When checking for such keys,
|
2019-08-01 15:36:12 +02:00
|
|
|
@@ -1126,6 +1129,16 @@ correct_key_code (int code)
|
|
|
|
if (c >= KEY_F (1) && c <= KEY_F (20))
|
2010-08-23 09:34:46 +02:00
|
|
|
mod &= ~KEY_M_SHIFT;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Numerals may require modifilers with some keymaps or on obscure
|
|
|
|
+ * keyboards (e. g. F4 = Esc Shift+4). We have to ignore all
|
|
|
|
+ * modifiers while interpreting Esc + Numeral.
|
|
|
|
+ */
|
|
|
|
+ if (c >= KEY_F_IMMUTABLE (1) && c <= KEY_F_IMMUTABLE (10)) {
|
|
|
|
+ c += KEY_F (0) - KEY_F_IMMUTABLE (0);
|
|
|
|
+ mod &= ~KEY_M_MASK;
|
|
|
|
+ }
|
|
|
|
+
|
2012-03-23 16:24:31 +01:00
|
|
|
if (!mc_global.tty.alternate_plus_minus)
|
2011-02-09 14:53:51 +01:00
|
|
|
switch (c)
|
|
|
|
{
|
2019-08-01 15:36:12 +02:00
|
|
|
@@ -1909,7 +1922,7 @@ get_key_code (int no_delay)
|
2013-07-18 18:35:38 +02:00
|
|
|
{
|
|
|
|
/* Convert escape-digits to F-keys */
|
|
|
|
if (g_ascii_isdigit (c))
|
|
|
|
- c = KEY_F (c - '0');
|
|
|
|
+ c = KEY_F_IMMUTABLE (c - '0');
|
|
|
|
else if (c == ' ')
|
|
|
|
c = ESC_CHAR;
|
|
|
|
else
|
2019-08-01 15:36:12 +02:00
|
|
|
Index: mc-4.8.23/lib/tty/tty-slang.h
|
2014-01-01 23:05:39 +01:00
|
|
|
===================================================================
|
2019-08-01 15:36:12 +02:00
|
|
|
--- mc-4.8.23.orig/lib/tty/tty-slang.h
|
|
|
|
+++ mc-4.8.23/lib/tty/tty-slang.h
|
2011-02-09 14:53:51 +01:00
|
|
|
@@ -11,6 +11,7 @@
|
|
|
|
/*** typedefs(not structures) and defined constants **********************************************/
|
2010-08-23 09:34:46 +02:00
|
|
|
|
2011-02-09 14:53:51 +01:00
|
|
|
#define KEY_F(x) (1000 + x)
|
2010-08-23 09:34:46 +02:00
|
|
|
+#define KEY_F_IMMUTABLE(x) (970+x)
|
|
|
|
|
2011-02-09 14:53:51 +01:00
|
|
|
#define ACS_VLINE SLSMG_VLINE_CHAR
|
|
|
|
#define ACS_HLINE SLSMG_HLINE_CHAR
|