From: Po Lu Date: Mon, 10 Jan 2022 01:59:34 +0000 (+0000) Subject: Map some more keypad keys on Haiku X-Git-Tag: emacs-29.0.90~3165 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f3b1badfd61c499f141ecbf95cf594e73a752e4a;p=emacs.git Map some more keypad keys on Haiku * src/haiku_support.cc (BMapKey): Rename to `be_map_key'. (be_map_key): Recognize more key codes. * src/haiku_support.h (BMapKey, be_map_key): Adjust accordingly. * src/haikuterm.c (haiku_read_socket): Likewise. --- diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 03d5dad7699..c4ff52a5305 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -1849,7 +1849,7 @@ BWindow_Flush (void *window) /* Map the keycode KC, storing the result in CODE and 1 in NON_ASCII_P if it should be used. */ void -BMapKey (uint32_t kc, int *non_ascii_p, unsigned *code) +be_map_key (uint32_t kc, int *non_ascii_p, unsigned *code) { if (*code == 10 && kc != 0x42) { @@ -1884,21 +1884,27 @@ BMapKey (uint32_t kc, int *non_ascii_p, unsigned *code) *code = XK_Down; break; case 0x64: + case 0x1f: *code = XK_Insert; break; case 0x65: + case 0x34: *code = XK_Delete; break; case 0x37: + case 0x20: *code = XK_Home; break; case 0x58: + case 0x35: *code = XK_End; break; case 0x39: + case 0x21: *code = XK_Page_Up; break; case 0x5a: + case 0x36: *code = XK_Page_Down; break; case 0x1: diff --git a/src/haiku_support.h b/src/haiku_support.h index 961d6d3a892..114e8429ab5 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h @@ -561,7 +561,7 @@ extern "C" BWindow_Flush (void *window); extern void - BMapKey (uint32_t kc, int *non_ascii_p, unsigned *code); + be_map_key (uint32_t kc, int *non_ascii_p, unsigned *code); extern void * BScrollBar_make_for_view (void *view, int horizontal_p, diff --git a/src/haikuterm.c b/src/haikuterm.c index dad40b8509c..e5bf917fb9a 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -2688,7 +2688,7 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) inev.code = b->unraw_mb_char; - BMapKey (b->kc, &non_ascii_p, &inev.code); + be_map_key (b->kc, &non_ascii_p, &inev.code); if (non_ascii_p) inev.kind = NON_ASCII_KEYSTROKE_EVENT;