Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
mc
mc-multi-press-f-keys.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mc-multi-press-f-keys.patch of Package mc
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.11/lib/tty/key.c =================================================================== --- mc-4.8.11.orig/lib/tty/key.c 2014-01-01 19:47:50.000000000 +0000 +++ mc-4.8.11/lib/tty/key.c 2014-01-01 19:47:50.000000000 +0000 @@ -1027,10 +1027,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, @@ -1116,6 +1119,16 @@ correct_key_code (int code) 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) { @@ -1919,7 +1932,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.11/lib/tty/tty-slang.h =================================================================== --- mc-4.8.11.orig/lib/tty/tty-slang.h 2013-04-10 21:04:31.000000000 +0100 +++ mc-4.8.11/lib/tty/tty-slang.h 2014-01-01 19:47:50.000000000 +0000 @@ -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
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor