mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-30 08:00:51 +00:00
Hacky key repeat handling, just like in_x11.c!
This commit is contained in:
parent
5da6fbe59c
commit
e7f6930efa
1 changed files with 13 additions and 3 deletions
|
@ -49,11 +49,12 @@ static const char rcsid[] =
|
||||||
|
|
||||||
cvar_t *in_snd_block;
|
cvar_t *in_snd_block;
|
||||||
|
|
||||||
|
static keydest_t old_key_dest = key_none;
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
event_focusout (void)
|
event_focusout (void)
|
||||||
{
|
{
|
||||||
// XAutoRepeatOn (x_disp);
|
|
||||||
if (in_snd_block->int_val) {
|
if (in_snd_block->int_val) {
|
||||||
S_BlockSound ();
|
S_BlockSound ();
|
||||||
CDAudio_Pause ();
|
CDAudio_Pause ();
|
||||||
|
@ -63,8 +64,6 @@ event_focusout (void)
|
||||||
static void
|
static void
|
||||||
event_focusin (void)
|
event_focusin (void)
|
||||||
{
|
{
|
||||||
// if (key_dest == key_game)
|
|
||||||
// XAutoRepeatOff (x_disp);
|
|
||||||
if (in_snd_block->int_val) {
|
if (in_snd_block->int_val) {
|
||||||
S_UnblockSound ();
|
S_UnblockSound ();
|
||||||
CDAudio_Resume ();
|
CDAudio_Resume ();
|
||||||
|
@ -79,7 +78,18 @@ IN_LL_SendKeyEvents (void)
|
||||||
knum_t ksym;
|
knum_t ksym;
|
||||||
short unicode;
|
short unicode;
|
||||||
|
|
||||||
|
|
||||||
while (SDL_PollEvent (&event)) {
|
while (SDL_PollEvent (&event)) {
|
||||||
|
// Ugly key repeat handling. Should use a key_dest callback...
|
||||||
|
if (old_key_dest != key_dest) {
|
||||||
|
old_key_dest = key_dest;
|
||||||
|
if (key_dest == key_game)
|
||||||
|
SDL_EnableKeyRepeat (0, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||||
|
else
|
||||||
|
SDL_EnableKeyRepeat (SDL_DEFAULT_REPEAT_DELAY,
|
||||||
|
SDL_DEFAULT_REPEAT_INTERVAL);
|
||||||
|
}
|
||||||
|
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
case SDL_ACTIVEEVENT:
|
case SDL_ACTIVEEVENT:
|
||||||
if (event.active.state == SDL_APPINPUTFOCUS) {
|
if (event.active.state == SDL_APPINPUTFOCUS) {
|
||||||
|
|
Loading…
Reference in a new issue