[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/6] i386: remap some keys
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 5/6] i386: remap some keys |
Date: |
Wed, 11 Jun 2014 09:51:16 +0200 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Mon 09 Jun 2014 18:38:34 +0200, a écrit :
> As a convenience for the nice people using our debugger, remap some
> keys to the readline-like shortcuts supported by dde.
>
> * i386/i386at/kd.c (kdcnmaygetc): Remap some keys.
Ack.
> ---
> i386/i386at/kd.c | 33 +++++++++++++++++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c
> index 5371fb2..7339767 100644
> --- a/i386/i386at/kd.c
> +++ b/i386/i386at/kd.c
> @@ -3029,6 +3029,39 @@ kdcnmaygetc(void)
> #ifdef notdef
> cnsetleds(state2leds(kd_state));
> #endif
> + } else if (! up
> + && c == K_ESC
> + && key_map[scancode][char_idx+1] == 0x5b) {
> + /* As a convenience for the nice
> + people using our debugger, remap
> + some keys to the readline-like
> + shortcuts supported by dde.
> +
> + XXX This is a workaround for the
> + limited kernel getchar interface.
> + It is only used by the debugger. */
> + c = key_map[scancode][char_idx+2];
> + switch (c) {
> +#define _MAP(A,B,C) (C)
> +#define MAP(T) _MAP(T)
> +#define CTRL(c) ((c) & 0x1f)
> + case MAP(K_HOME): c = CTRL('a'); break;
> + case MAP(K_UA): c = CTRL('p'); break;
> + case MAP(K_LA): c = CTRL('b'); break;
> + case MAP(K_RA): c = CTRL('f'); break;
> + case MAP(K_DA): c = CTRL('n'); break;
> + case MAP(K_END): c = CTRL('e'); break;
> + /* delete */
> + case 0x39: c = CTRL('d'); break;
> +#undef CTRL
> +#undef MAP
> +#undef _MAP
> + default:
> + /* Retain the old behavior. */
> + c = K_ESC;
> + }
> +
> + return(c);
> } else if (!up) {
> /* regular key-down */
> if (c == K_CR)
> --
> 2.0.0
>
>
--
Samuel
"...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and
the Ugly)."
(By Matt Welsh)
- [PATCH 1/6] kern: set the name of the kernel task to 'gnumach', Justus Winter, 2014/06/09
- [PATCH 2/6] ddb: print task names if available, Justus Winter, 2014/06/09
- [PATCH 3/6] ddb: use db_thread_stat to format the flags, Justus Winter, 2014/06/09
- [PATCH 4/6] i386: reformat the key map, Justus Winter, 2014/06/09
- [PATCH 5/6] i386: remap some keys, Justus Winter, 2014/06/09
- Re: [PATCH 5/6] i386: remap some keys,
Samuel Thibault <=
- [PATCH 6/6] doc: explain the floating point flag in kdb output, Justus Winter, 2014/06/09
- Re: [PATCH 1/6] kern: set the name of the kernel task to 'gnumach', Samuel Thibault, 2014/06/11