Compare commits

...

3 commits

Author SHA1 Message Date
nadrad 1d61a40788 another alternative for "home" and "end" key codes! 2023-07-25 12:00:09 +02:00
nadrad 18d273015f alternative codes for "home" and "end" keys 2023-07-25 09:17:21 +02:00
nadrad 4562afb527 echo-keys switch for troubleshooting 2023-07-25 09:09:07 +02:00

16
h-m-m
View file

@ -123,6 +123,7 @@ config($mm, 'clipboard_in_command', "");
config($mm, 'clipboard_out_command', "");
config($mm, 'auto_save', false);
config($mm, 'echo_keys', false);
if (isset($mm['arguments']['debug_config']))
@ -247,6 +248,9 @@ const special_keys =
'home' => "\033\133\110",
'end' => "\033\133\106",
'home_alternative' => "\033\133\061\176",
'end_alternative' => "\033\133\064\176",
'del' => "\033\133\063\176",
'ctrl_del' => "\033\133\63\073\065\176",
'back_space' => "\177",
@ -3601,11 +3605,13 @@ function monitor_key_presses(&$mm)
if (isset($keybindings[$in]))
call_user_func($keybindings[$in]);
// uncomment the following to discover the escape codes:
// echo "\033[1;1f";
// for ($i=0; $i<strlen($in); $i++)
// echo base_convert(ord($in[$i]),10,8).' ';
// echo ' ';
if ($mm['echo_keys'])
{
echo "\033[1;1f";
for ($i=0; $i<strlen($in); $i++)
echo base_convert(ord($in[$i]),10,8).' ';
echo ' ';
}
}
}