mirror of https://github.com/encounter/SDL.git
riscos: Report keyboard repeat events
This commit is contained in:
parent
af40cb6f00
commit
98353533e5
|
@ -67,7 +67,6 @@ RISCOS_PollKeyboard(_THIS)
|
||||||
|
|
||||||
/* Check for key presses */
|
/* Check for key presses */
|
||||||
while (key < 0xff) {
|
while (key < 0xff) {
|
||||||
SDL_bool already_pressed = SDL_FALSE;
|
|
||||||
key = _kernel_osbyte(121, key + 1, 0) & 0xff;
|
key = _kernel_osbyte(121, key + 1, 0) & 0xff;
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 255:
|
case 255:
|
||||||
|
@ -83,22 +82,16 @@ RISCOS_PollKeyboard(_THIS)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* Do we already know of this key? */
|
SDL_SendKeyboardKey(SDL_PRESSED, SDL_RISCOS_translate_keycode(key));
|
||||||
|
|
||||||
|
/* Record the press so we can detect release later. */
|
||||||
for (i = 0; i < RISCOS_MAX_KEYS_PRESSED; i++) {
|
for (i = 0; i < RISCOS_MAX_KEYS_PRESSED; i++) {
|
||||||
if (driverdata->key_pressed[i] == key) {
|
if (driverdata->key_pressed[i] == key) {
|
||||||
already_pressed = SDL_TRUE;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
if (driverdata->key_pressed[i] == 255) {
|
||||||
|
driverdata->key_pressed[i] = key;
|
||||||
if (!already_pressed) {
|
break;
|
||||||
SDL_SendKeyboardKey(SDL_PRESSED, SDL_RISCOS_translate_keycode(key));
|
|
||||||
/* Record the press so we can detect release later. */
|
|
||||||
for (i = 0; i < RISCOS_MAX_KEYS_PRESSED; i++) {
|
|
||||||
if (driverdata->key_pressed[i] == 255) {
|
|
||||||
driverdata->key_pressed[i] = key;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue