Capital letter bug in new input code fixed, from slayne

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@520 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
gewlitys
2003-01-02 16:07:32 +00:00
parent ef48bf8645
commit 74bebe800e
3 changed files with 10 additions and 5 deletions
+1
View File
@@ -1,4 +1,5 @@
0.2: 0.2:
- Capital letter bug in new input code fixed, from slayne
- Oscilloscope now reacts to music when speech is disabled (OpenAL) -Mika - Oscilloscope now reacts to music when speech is disabled (OpenAL) -Mika
- Rewritten input code (better and adds joystick/pad support), from slayne - Rewritten input code (better and adds joystick/pad support), from slayne
- Biadapt scaling for pure mode, from fOSSiL - Biadapt scaling for pure mode, from fOSSiL
@@ -69,7 +69,6 @@ TFB_InitGraphics (int driver, int flags, int width, int height, int bpp)
result = TFB_Pure_InitGraphics (driver, flags, width, height, bpp); result = TFB_Pure_InitGraphics (driver, flags, width, height, bpp);
} }
SDL_EnableUNICODE (1);
sprintf (caption, "The Ur-Quan Masters v%d.%d", UQM_MAJOR_VERSION, UQM_MINOR_VERSION); sprintf (caption, "The Ur-Quan Masters v%d.%d", UQM_MAJOR_VERSION, UQM_MINOR_VERSION);
SDL_WM_SetCaption (caption, NULL); SDL_WM_SetCaption (caption, NULL);
+9 -4
View File
@@ -24,7 +24,7 @@
static Uint8 KeyboardDown[SDLK_LAST]; static Uint8 KeyboardDown[SDLK_LAST];
#define KBDBUFSIZE (1 << 8) #define KBDBUFSIZE (1 << 8)
static int kbdhead=0, kbdtail=0; static int kbdhead=0, kbdtail=0;
static SDLKey kbdbuf[KBDBUFSIZE]; static UNICODE kbdbuf[KBDBUFSIZE];
static int nJoysticks = 0; static int nJoysticks = 0;
static SDL_Joystick **Joysticks = 0; static SDL_Joystick **Joysticks = 0;
@@ -48,6 +48,8 @@ TFB_InitInput (int driver, int flags)
atexit (TFB_UninitInput); atexit (TFB_UninitInput);
SDL_EnableUNICODE(1);
if ((SDL_InitSubSystem(SDL_INIT_JOYSTICK)) == -1) if ((SDL_InitSubSystem(SDL_INIT_JOYSTICK)) == -1)
{ {
fprintf (stderr, "Couldn't initialize joystick subsystem: %s\n", SDL_GetError()); fprintf (stderr, "Couldn't initialize joystick subsystem: %s\n", SDL_GetError());
@@ -113,7 +115,10 @@ ProcessKeyboardEvent(const SDL_Event *Event)
if (Event->type == SDL_KEYDOWN) if (Event->type == SDL_KEYDOWN)
{ {
kbdbuf[kbdtail] = k; if (Event->key.keysym.unicode != 0)
kbdbuf[kbdtail] = Event->key.keysym.unicode;
else
kbdbuf[kbdtail] = KBDToUNICODE(k);
kbdtail = (kbdtail + 1) & (KBDBUFSIZE - 1); kbdtail = (kbdtail + 1) & (KBDBUFSIZE - 1);
if (kbdtail == kbdhead) if (kbdtail == kbdhead)
kbdhead = (kbdhead + 1) & (KBDBUFSIZE - 1); kbdhead = (kbdhead + 1) & (KBDBUFSIZE - 1);
@@ -316,11 +321,11 @@ GetUNICODEKey (void)
{ {
if (kbdtail != kbdhead) if (kbdtail != kbdhead)
{ {
SDLKey ch; UNICODE ch;
ch = kbdbuf[kbdhead]; ch = kbdbuf[kbdhead];
kbdhead = (kbdhead + 1) & (KBDBUFSIZE - 1); kbdhead = (kbdhead + 1) & (KBDBUFSIZE - 1);
return KBDToUNICODE(ch); return (ch);
} }
return (0); return (0);
} }