Skip to content

Commit

Permalink
Fix #184
Browse files Browse the repository at this point in the history
  • Loading branch information
skejeton committed Jul 12, 2024
1 parent 6c2c6df commit 3de9ed3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ event(const sapp_event *ev)
thg->mouse = (th_vf2){.x = ev->mouse_x, .y = ev->mouse_y};
break;
case SAPP_EVENTTYPE_CHAR:
if (ev->char_code < ' ' || ev->char_code == 127 /* DEL character */)
// NOTE: Here is a hotfix for a strange behaviour where sokol would insert the space
// character if Ctrl is pressed.
if (ev->char_code < ' ' || ev->char_code == 127 /* DEL character */ ||
((ev->modifiers & SAPP_MODIFIER_CTRL) && ev->char_code == ' '))
break;

thg->input_string_len = th_utf8_encode(thg->input_string, ev->char_code);
Expand Down

0 comments on commit 3de9ed3

Please sign in to comment.