diff options
| author | Francesco Abbate <francesco.bbt@gmail.com> | 2021-09-19 18:42:36 +0200 |
|---|---|---|
| committer | Francesco Abbate <francesco.bbt@gmail.com> | 2021-10-02 18:37:01 +0200 |
| commit | 48475c70a09d42cfcfc2350c0855b3a43e15163c (patch) | |
| tree | e81ce986058b2bba302845749d17f29be646942a /src | |
| parent | ab73f914add4d829d5c90f35fce35a7d38276990 (diff) | |
| download | lite-xl-48475c70a09d42cfcfc2350c0855b3a43e15163c.tar.gz lite-xl-48475c70a09d42cfcfc2350c0855b3a43e15163c.zip | |
Avoid unnecessary call to SDL_GetModState
Diffstat (limited to 'src')
| -rw-r--r-- | src/api/system.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/system.c b/src/api/system.c index f69de477..d84f86dd 100644 --- a/src/api/system.c +++ b/src/api/system.c @@ -98,7 +98,7 @@ static const char *get_key_name(const SDL_Event *e, char *buf) { ** We assume that SDL_SCANCODE_KP_1 up to SDL_SCANCODE_KP_9 and SDL_SCANCODE_KP_0 ** and SDL_SCANCODE_KP_PERIOD are declared in SDL2 in that order. */ if (scancode >= SDL_SCANCODE_KP_1 && scancode <= SDL_SCANCODE_KP_1 + 10 && - !(KMOD_NUM & SDL_GetModState())) { + !(e->key.keysym.mod & KMOD_NUM)) { return numpad[scancode - SDL_SCANCODE_KP_1]; } else { strcpy(buf, SDL_GetKeyName(e->key.keysym.sym)); |
