Skip to content

Commit

Permalink
add up/down/ctrl-b/ctrl-e key handling to d3d11 demo
Browse files Browse the repository at this point in the history
  • Loading branch information
xzn authored and RobLoach committed Oct 2, 2024
1 parent 2ad47c0 commit e360f26
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions demo/d3d11/nuklear_d3d11.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e360f26

Please sign in to comment.