mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-25 23:13:39 +00:00
[client] app: move SDL key event handling out of main.c
This commit is contained in:
parent
7c9b273f70
commit
36b70779b9
@ -109,6 +109,20 @@ static bool sdlEventFilter(SDL_Event * event)
|
||||
return true;
|
||||
}
|
||||
|
||||
case SDL_KEYDOWN:
|
||||
{
|
||||
SDL_Scancode sc = event->key.keysym.scancode;
|
||||
app_handleKeyPress(sc);
|
||||
break;
|
||||
}
|
||||
|
||||
case SDL_KEYUP:
|
||||
{
|
||||
SDL_Scancode sc = event->key.keysym.scancode;
|
||||
app_handleKeyRelease(sc);
|
||||
break;
|
||||
}
|
||||
|
||||
case SDL_WINDOWEVENT:
|
||||
switch(event->window.event)
|
||||
{
|
||||
|
@ -1455,23 +1455,6 @@ int eventFilter(void * userdata, SDL_Event * event)
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch(event->type)
|
||||
{
|
||||
case SDL_KEYDOWN:
|
||||
{
|
||||
SDL_Scancode sc = event->key.keysym.scancode;
|
||||
app_handleKeyPress(sc);
|
||||
break;
|
||||
}
|
||||
|
||||
case SDL_KEYUP:
|
||||
{
|
||||
SDL_Scancode sc = event->key.keysym.scancode;
|
||||
app_handleKeyRelease(sc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// consume all events
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user