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