Skip to content

Commit

Permalink
try to fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ColleagueRiley committed Jul 4, 2024
1 parent 6e4deac commit 9edd91e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion example/ext/RGFW.h
Original file line number Diff line number Diff line change
Expand Up @@ -2337,7 +2337,12 @@ Start of Linux / Unix defines
/* set event key data */
KeySym sym = XkbKeycodeToKeysym((Display*) win->src.display, E.xkey.keycode, 0, E.xkey.state & ShiftMask ? 1 : 0);
win->event.keyCode = RGFW_apiKeyCodeToRGFW(E.xkey.keycode);
strncpy(win->event.keyName, XKeysymToString(sym), 16);

char* str = XKeysymToString(sym);
if (str != NULL)
strncpy(win->event.keyName, str, 16);

win->event.keyName[15] = '\0';

RGFW_keyboard[win->event.keyCode].prev = RGFW_isPressed(win, win->event.keyCode);

Expand Down

0 comments on commit 9edd91e

Please sign in to comment.