1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Restor numpad direction like arrow keys (with or without numlock)

It fixes the issue #101.
This commit is contained in:
Mathieu Schroeter 2022-01-14 23:35:15 +01:00
parent 58d18d52b2
commit e9c99fbad9
No known key found for this signature in database
GPG Key ID: 8B9145A5FA9DA8A8

View File

@ -5910,10 +5910,13 @@ CEvent::TreatEventBase (const SDL_Event & event)
return true;
case SDLK_LEFT:
case SDLK_KP_4:
case SDLK_RIGHT:
case SDLK_KP_6:
case SDLK_UP:
case SDLK_KP_8:
case SDLK_DOWN:
{
case SDLK_KP_2: {
if (m_phase != EV_PHASE_PLAY && m_phase != EV_PHASE_BUILD)
return true;
@ -5923,12 +5926,16 @@ CEvent::TreatEventBase (const SDL_Event & event)
this->shiftDirection = 0;
left = event.key.keysym.sym == SDLK_LEFT ||
event.key.keysym.sym == SDLK_KP_4 ||
(!m_bDemoRec && state[SDL_SCANCODE_LEFT]);
right = event.key.keysym.sym == SDLK_RIGHT ||
event.key.keysym.sym == SDLK_KP_6 ||
(!m_bDemoRec && state[SDL_SCANCODE_RIGHT]);
up = event.key.keysym.sym == SDLK_UP ||
event.key.keysym.sym == SDLK_KP_8 ||
(!m_bDemoRec && state[SDL_SCANCODE_UP]);
down = event.key.keysym.sym == SDLK_DOWN ||
event.key.keysym.sym == SDLK_KP_2 ||
(!m_bDemoRec && state[SDL_SCANCODE_DOWN]);
if (left)