mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-08-18 01:15:59 +00:00
Fix some keys in SDL
This commit is contained in:
parent
92112f292a
commit
abc9a19a9d
@ -43,7 +43,7 @@ static int keyboard_modifiers;
|
||||
void sdlinput_init() {
|
||||
memset(gamepads, 0, sizeof(gamepads));
|
||||
|
||||
SDL_SetRelativeMouseMode(SDL_TRUE);
|
||||
//SDL_SetRelativeMouseMode(SDL_TRUE);
|
||||
SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER);
|
||||
SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt");
|
||||
|
||||
@ -101,9 +101,9 @@ bool sdlinput_handle_event(SDL_Event* event) {
|
||||
case SDL_KEYDOWN:
|
||||
case SDL_KEYUP:
|
||||
button = event->key.keysym.sym;
|
||||
if (button >= (0x40000000 + 0x39) && button < (0x40000000 + sizeof(keyCodes)))
|
||||
if (button >= (0x40000000 + 0x39) && button < (0x40000000 + 0x39 + sizeof(keyCodes)))
|
||||
button = keyCodes[button - 0x40000039];
|
||||
if (button >= 0x61)
|
||||
else if (button >= 0x61)
|
||||
button -= 0x20;
|
||||
|
||||
int modifier = 0;
|
||||
|
@ -42,6 +42,7 @@ static const short keyCodes[] = {
|
||||
0x9B, //SDLK_INSERT
|
||||
0x24, //SDLK_HOME
|
||||
0x21, //SDLK_PAGEUP
|
||||
0, //Not used
|
||||
0x23, //SDLK_END
|
||||
0x22, //SDLK_PAGEDOWN
|
||||
0x27, //SDLK_RIGHT
|
||||
|
Loading…
x
Reference in New Issue
Block a user