diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-01-07 10:14:40 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-01-07 10:14:40 +0100 |
| commit | 2db1929985f430d3be1f87222aa85599bb2b8222 (patch) | |
| tree | 696888ba34247d982385723c5b7e6670bb6744e8 /src/drivers | |
| parent | b4697c33ff2eda9359044047f07d2fa1f6811221 (diff) | |
Wayland: fix processing of keypad keys - tidying (#881)
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx index 381def421..c30301a8a 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx @@ -728,20 +728,17 @@ static void wl_keyboard_key(void *data, struct wl_keyboard *wl_keyboard, #endif Fl::e_keysym = Fl::e_original_keysym = for_key_vector; if (!(Fl::e_state & FL_NUM_LOCK) && sym >= XKB_KEY_KP_Home && sym <= XKB_KEY_KP_Delete) { - // compute e_keysym for keypad number keys when NumLock is off + // compute e_keysym and e_original_keysym for keypad number keys and '.|,' when NumLock is off static const int table[11] = {FL_Home /* 7 */, FL_Left /* 4 */, FL_Up /* 8 */, FL_Right /* 6 */, FL_Down /* 2 */, FL_Page_Up /* 9 */, FL_Page_Down /* 3 */, FL_End /* 1 */, 0xff0b /* 5 */, - FL_Insert /* 0 */, FL_Delete /* ./, */}; - Fl::e_keysym = table[sym - XKB_KEY_KP_Home]; - } - if (!(Fl::e_state & FL_NUM_LOCK) && sym >= XKB_KEY_KP_Home && sym <= XKB_KEY_KP_Delete) { - // compute e_original_keysym for keypad keys when NumLock is off - static const int table[11] = {0xffb7 /* 7 */, 0xffb4 /* 4 */, 0xffb8 /* 8 */, - 0xffb6 /* 6 */, 0xffb2 /* 2 */, 0xffb9 /* 9 */, - 0xffb3 /* 3 */, 0xffb1 /* 1 */, 0xffb5 /* 5 */, - 0xffb0 /* 0 */, 0xffac /* ./, */}; - Fl::e_original_keysym = table[sym - XKB_KEY_KP_Home]; + FL_Insert /* 0 */, FL_Delete /* .|, */}; + static const int table_original[11] = {0xffb7 /* 7 */, 0xffb4 /* 4 */, 0xffb8 /* 8 */, + 0xffb6 /* 6 */, 0xffb2 /* 2 */, 0xffb9 /* 9 */, + 0xffb3 /* 3 */, 0xffb1 /* 1 */, 0xffb5 /* 5 */, + 0xffb0 /* 0 */, 0xffac /* .|, */}; + Fl::e_keysym = table[sym - XKB_KEY_KP_Home]; + Fl::e_original_keysym = table_original[sym - XKB_KEY_KP_Home]; } #if (DEBUG_KEYBOARD) fprintf(stderr, "wl_keyboard_key: e_keysym=%x e_original_keysym=%x\n", Fl::e_keysym, Fl::e_original_keysym); |
