Key repeat is now enabled when typing text, some little cleanups, from
slayne git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@521 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
0.2:
|
||||
- Key repeat is now enabled when typing text, from slayne
|
||||
- Capital letter bug in new input code fixed, from slayne
|
||||
- Oscilloscope now reacts to music when speech is disabled (OpenAL) -Mika
|
||||
- Rewritten input code (better and adds joystick/pad support), from slayne
|
||||
|
||||
@@ -49,6 +49,7 @@ TFB_InitInput (int driver, int flags)
|
||||
atexit (TFB_UninitInput);
|
||||
|
||||
SDL_EnableUNICODE(1);
|
||||
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||
|
||||
if ((SDL_InitSubSystem(SDL_INIT_JOYSTICK)) == -1)
|
||||
{
|
||||
@@ -116,7 +117,7 @@ ProcessKeyboardEvent(const SDL_Event *Event)
|
||||
if (Event->type == SDL_KEYDOWN)
|
||||
{
|
||||
if (Event->key.keysym.unicode != 0)
|
||||
kbdbuf[kbdtail] = Event->key.keysym.unicode;
|
||||
kbdbuf[kbdtail] = (UNICODE) Event->key.keysym.unicode;
|
||||
else
|
||||
kbdbuf[kbdtail] = KBDToUNICODE(k);
|
||||
kbdtail = (kbdtail + 1) & (KBDBUFSIZE - 1);
|
||||
@@ -401,18 +402,21 @@ _get_pause_exit_state (void)
|
||||
return (InputState);
|
||||
}
|
||||
|
||||
// Status: Unimplemented
|
||||
INPUT_STATE
|
||||
_get_serial_keyboard_state (INPUT_REF ref, INPUT_STATE InputState)
|
||||
// I hope these are defined somewhere...
|
||||
{
|
||||
Uint16 key;
|
||||
(void) ref;
|
||||
|
||||
if ((key = GetUNICODEKey ()) == '\r')
|
||||
key = '\n';
|
||||
if (key != 0)
|
||||
{
|
||||
SetInputUNICODE (&InputState, key);
|
||||
SetInputDevType (&InputState, KEYBOARD_DEVICE);
|
||||
}
|
||||
else
|
||||
InputState = 0;
|
||||
|
||||
return (InputState);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user