Skip to content

Commit 9c3d4cb

Browse files
committed
Fixed some SDL2 Key not showing properly in Config screen (some may still need a fix)
1 parent 679054b commit 9c3d4cb

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

FrontEnd.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
#include "Engine.h"
2+
3+
#ifndef USE_SDL2
4+
#define SDLK_SCANCODE_MASK 0
5+
#endif
6+
27
void Engine::StartFadeIn()
38
{
49
// gLog.OutPut("StartFadeIn Called\n");
@@ -583,10 +588,10 @@ void Engine::RenderConfig(const float interp)
583588
mFont1.Print(mKeys[n].KeyName,110,168 + (40*(float)n));
584589
iOption==n?
585590
(bConfigureKey? mFont1.SetColor(0,1,1,1): mFont1.SetColor(1,1,0,1)): mFont1.SetColor(1,1,1,1);
586-
mFont1.Print(SDLKeyStrings[mKeys[n].PrimaryKey],280,168 + (40*(float)n));
591+
mFont1.Print(SDLKeyStrings[mKeys[n].PrimaryKey & ~SDLK_SCANCODE_MASK],280,168 + (40*(float)n));
587592
iOption==(n+6)?
588593
(bConfigureKey? mFont1.SetColor(0,1,1,1): mFont1.SetColor(1,1,0,1)): mFont1.SetColor(1,1,1,1);
589-
mFont1.Print(SDLKeyStrings[mKeys[n].SecondaryKey],420,168 + (40*(float)n));
594+
mFont1.Print(SDLKeyStrings[mKeys[n].SecondaryKey & ~SDLK_SCANCODE_MASK],420,168 + (40*(float)n));
590595
}
591596

592597
mFont1.SetAlignment(ALIGN_CENTER);

SDL_KeyMap.h

100644100755
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,22 @@ static char* SDLKeyStrings[] = {
7272
"GREATER", //62
7373
"QUESTION", //63
7474
"AT", //64
75+
#ifdef USE_SDL2
76+
"","","","","","","","",
77+
"INSERT", //73
78+
"HOME", //74
79+
"PAGE UP", //75
80+
"DELETE", //76
81+
"END", //77
82+
"PAGE DOWN", //78
83+
"RIGHT", //79
84+
"LEFT", //80
85+
"DOWN", //81
86+
"UP", //82
87+
"", "","","","","","","",
88+
#else
7589
"","","","","","","","","","","","","","","","","","","","","","","","","","",
90+
#endif
7691
"LEFTBRACKET", //91
7792
"BACKSLASH", //92
7893
"RIGHTBRACKET", //93
@@ -172,12 +187,21 @@ static char* SDLKeyStrings[] = {
172187
"WORLD_61", //221
173188
"WORLD_62", //222
174189
"WORLD_63", //223
190+
#ifdef USE_SDL2
191+
"L CTRL", //224
192+
"L SHIFT", //225
193+
"L ALT", //226
194+
"R ALT", //227
195+
"R SHIFT", //228
196+
"R CTRL", //229
197+
#else
175198
"WORLD_64", //224
176199
"WORLD_65", //225
177200
"WORLD_66", //226
178201
"WORLD_67", //227
179202
"WORLD_68", //228
180203
"WORLD_69", //229
204+
#endif
181205
"WORLD_70", //230
182206
"WORLD_71", //231
183207
"WORLD_72", //232

0 commit comments

Comments
 (0)