From e360f267ed07557068130a15ae3a74830eb91e18 Mon Sep 17 00:00:00 2001 From: JS Deck Date: Tue, 1 Oct 2024 05:10:23 -0300 Subject: [PATCH] add up/down/ctrl-b/ctrl-e key handling to d3d11 demo --- demo/d3d11/nuklear_d3d11.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/demo/d3d11/nuklear_d3d11.h b/demo/d3d11/nuklear_d3d11.h index c62be5685..8b9e1e565 100644 --- a/demo/d3d11/nuklear_d3d11.h +++ b/demo/d3d11/nuklear_d3d11.h @@ -239,6 +239,14 @@ nk_d3d11_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam) nk_input_key(&d3d11.ctx, NK_KEY_TAB, down); return 1; + case VK_UP: + nk_input_key(&d3d11.ctx, NK_KEY_UP, down); + return 1; + + case VK_DOWN: + nk_input_key(&d3d11.ctx, NK_KEY_DOWN, down); + return 1; + case VK_LEFT: if (ctrl) nk_input_key(&d3d11.ctx, NK_KEY_TEXT_WORD_LEFT, down); @@ -275,6 +283,20 @@ nk_d3d11_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam) nk_input_key(&d3d11.ctx, NK_KEY_SCROLL_UP, down); return 1; + case 'B': + if (ctrl) { + nk_input_key(&d3d11.ctx, NK_KEY_TEXT_LINE_START, down); + return 1; + } + break; + + case 'E': + if (ctrl) { + nk_input_key(&d3d11.ctx, NK_KEY_TEXT_LINE_END, down); + return 1; + } + break; + case 'C': if (ctrl) { nk_input_key(&d3d11.ctx, NK_KEY_COPY, down);