This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFC] Add handling of VK_HOME, VK_END, VK_DELETE and VK_INSERT for mingw hosts
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: <gdb-patches at sourceware dot org>
- Date: Mon, 10 Dec 2012 15:11:36 +0100
- Subject: [RFC] Add handling of VK_HOME, VK_END, VK_DELETE and VK_INSERT for mingw hosts
The patch below adds support
for Home, End, Insert and Delete keys for mingw hosts.
It works both for mingw32 and mingw64 native builds.
I also added some description of the bounds added.
The code that handles console input in gdb/ser-mingw.c
has the 8 keys handled after my patch plus
VK_PRIOR and VK_NEXT, which correspond to PageUp and PageDown keys...
Any ideas what readline translation would be useful for those?
What repository is the main readline maintainer?
Should I submit the patch there?
Pierre Muller
GDB pascal language maintainer
2012-12-10 Pierre Muller <muller@sourceware.org>
* readline.c (bind_arrow_keys_internal): Add missing handling of
VK_HOME, VK_END, VK_DELETE and VK_INSERT for mingw hosts.
Index: src/gdb/readline.c
===================================================================
RCS file: /cvs/src/src/readline/readline.c,v
retrieving revision 1.11
diff -u -p -r1.11 readline.c
--- src/gdb/readline.c 11 May 2011 23:38:39 -0000 1.11
+++ src/gdb/readline.c 10 Dec 2012 13:33:17 -0000
@@ -1155,10 +1155,24 @@ bind_arrow_keys_internal (map)
rl_bind_keyseq_if_unbound ("\033OF", rl_end_of_line);
#if defined (__MINGW32__)
+ /* Handle Windows OS special ekys sent as 0xe0 followed
+ by keycode. */
+ /* Handles VK_UP keycode. */
rl_bind_keyseq_if_unbound ("\340H", rl_get_previous_history);
+ /* Handles VK_DOWN keycode. */
rl_bind_keyseq_if_unbound ("\340P", rl_get_next_history);
+ /* Handles VK_RIGHT keycode. */
rl_bind_keyseq_if_unbound ("\340M", rl_forward_char);
+ /* Handles VK_LEFT keycode. */
rl_bind_keyseq_if_unbound ("\340K", rl_backward_char);
+ /* Handles VK_HOME keycode. */
+ rl_bind_keyseq_if_unbound ("\340G", rl_beg_of_line);
+ /* Handles VK_END keycode. */
+ rl_bind_keyseq_if_unbound ("\340O", rl_end_of_line);
+ /* Handles VK_DELETE keycode. */
+ rl_bind_keyseq_if_unbound ("\340S", rl_delete);
+ /* Handles VK_INSERT keycode. */
+ rl_bind_keyseq_if_unbound ("\340R", rl_overwrite_mode);
#endif
_rl_keymap = xkeymap;