Skip to content

Commit

Permalink
also allow space for keyboard clicks
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanfleury committed Jan 23, 2024
1 parent 804a840 commit f50ffd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/df/gfx/df_views.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
UI_NavActionList *nav_actions = ui_nav_actions();
for(UI_NavActionNode *n = nav_actions->first; n != 0; n = n->next)
{
if(n->v.insertion.size != 0 || n->v.flags & UI_NavActionFlag_Paste)
if(!str8_match(n->v.insertion, str8_lit(" "), 0) && (n->v.insertion.size != 0 || n->v.flags & UI_NavActionFlag_Paste))
{
edit_begin = 1;
break;
Expand Down
3 changes: 2 additions & 1 deletion src/ui/ui_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2437,7 +2437,8 @@ ui_signal_from_box(UI_Box *box)
B32 keyboard_click = 0;
if(!disabled && is_focused && box->flags & UI_BoxFlag_KeyboardClickable)
{
if(os_key_press(ui_events(), ui_window(), 0, OS_Key_Return))
if(os_key_press(ui_events(), ui_window(), 0, OS_Key_Return) != 0 ||
os_key_press(ui_events(), ui_window(), 0, OS_Key_Space) != 0)
{
keyboard_click = 1;
result.clicked = 1;
Expand Down

0 comments on commit f50ffd1

Please sign in to comment.