add up/down/ctrl-b/ctrl-e key handling to d3d11 demo

This commit is contained in:
JS Deck 2024-10-01 05:10:23 -03:00 committed by Rob Loach
parent 2ad47c08f1
commit e360f267ed

View File

@ -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);