mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-14 21:17:54 +00:00
[client] app: move SDL key event handling out of main.c
This commit is contained in:
parent
7c9b273f70
commit
36b70779b9
2 changed files with 14 additions and 17 deletions
|
@ -109,6 +109,20 @@ static bool sdlEventFilter(SDL_Event * event)
|
||||||
return true;
|
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:
|
case SDL_WINDOWEVENT:
|
||||||
switch(event->window.event)
|
switch(event->window.event)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1455,23 +1455,6 @@ int eventFilter(void * userdata, SDL_Event * event)
|
||||||
return 0;
|
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
|
// consume all events
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue