File mc-multi-press-f-keys-4.8.2.patch of Package mc
diff -U 3 -H -d -r -N -- mc-4.8.0-orig/lib/tty/key.c mc-4.8.0/lib/tty/key.c
--- mc-4.8.0-orig/lib/tty/key.c 2011-10-18 15:39:19.000000000 +0400
+++ mc-4.8.0/lib/tty/key.c 2011-10-20 01:53:28.737738395 +0400
@@ -1103,10 +1103,13 @@
}
}
- /* 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,
@@ -1060,6 +1063,16 @@
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;
+ }
+
if (!mc_global.tty.alternate_plus_minus)
switch (c)
{
@@ -1842,7 +1855,7 @@
{
/* 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
diff -U 3 -H -d -r -N -- mc-4.8.0-orig/lib/tty/tty-slang.h mc-4.8.0/lib/tty/tty-slang.h
--- mc-4.8.0-orig/lib/tty/tty-slang.h 2011-09-20 16:17:54.000000000 +0400
+++ mc-4.8.0/lib/tty/tty-slang.h 2011-10-20 01:50:30.467836374 +0400
@@ -11,6 +11,7 @@
/*** typedefs(not structures) and defined constants **********************************************/
#define KEY_F(x) (1000 + x)
+#define KEY_F_IMMUTABLE(x) (970+x)
#define ACS_VLINE SLSMG_VLINE_CHAR
#define ACS_HLINE SLSMG_HLINE_CHAR