Adam Majer
eb8146e32e
- Use python3 instead of python as we do not need to depend on python2 - Format with spec-cleaner - update to 4.8.23: * Modify "File exists" query dialog (#3935): * Speed up of large directory structures delete (#3958) * Support key binding for menu (#212) * Syntax updates: + shell (#3981) + ebuild (#3988) + RPM spec (#3991) * Code cleanup (#3955) * Use Geeqie (a fork of GQview) as main image viewer, fallback to GQview (#3962) * various small fixes - Refresh patches: * mc-multi-press-f-keys.patch * sftp_interactive_password.patch OBS-URL: https://build.opensuse.org/request/show/720147 OBS-URL: https://build.opensuse.org/package/show/Base:System/mc?expand=0&rev=126
64 lines
2.1 KiB
Diff
64 lines
2.1 KiB
Diff
http://www.midnight-commander.org/ticket/287
|
|
---
|
|
lib/tty/key.c | 17 +++++++++++++++--
|
|
lib/tty/tty-slang.h | 1 +
|
|
2 files changed, 16 insertions(+), 2 deletions(-)
|
|
|
|
Index: mc-4.8.23/lib/tty/key.c
|
|
===================================================================
|
|
--- 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)
|
|
mod = KEY_M_SHIFT;
|
|
}
|
|
|
|
- /* 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,
|
|
@@ -1126,6 +1129,16 @@ correct_key_code (int code)
|
|
if (c >= KEY_F (1) && c <= KEY_F (20))
|
|
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)
|
|
{
|
|
@@ -1909,7 +1922,7 @@ get_key_code (int no_delay)
|
|
{
|
|
/* 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
|
|
Index: mc-4.8.23/lib/tty/tty-slang.h
|
|
===================================================================
|
|
--- mc-4.8.23.orig/lib/tty/tty-slang.h
|
|
+++ mc-4.8.23/lib/tty/tty-slang.h
|
|
@@ -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
|