projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20020417-1-src
[rocksndiamonds.git]
/
src
/
events.c
diff --git
a/src/events.c
b/src/events.c
index 879b5396dd22f13549eb52245e15e97d1fa71db5..f67bc13ecac7dc8bb5d3aed4e151383cea5b7439 100644
(file)
--- a/
src/events.c
+++ b/
src/events.c
@@
-176,6
+176,16
@@
void ClearEventQueue()
}
}
}
}
+void ClearPlayerAction()
+{
+ int i;
+
+ /* simulate key release events for still pressed keys */
+ key_joystick_mapping = 0;
+ for (i=0; i<MAX_PLAYERS; i++)
+ stored_player[i].action = 0;
+}
+
void SleepWhileUnmapped()
{
boolean window_unmapped = TRUE;
void SleepWhileUnmapped()
{
boolean window_unmapped = TRUE;
@@
-269,16
+279,11
@@
void HandleFocusEvent(FocusChangeEvent *event)
if (event->type == EVENT_FOCUSOUT)
{
if (event->type == EVENT_FOCUSOUT)
{
- int i;
-
KeyboardAutoRepeatOn();
old_joystick_status = joystick.status;
joystick.status = JOYSTICK_NOT_AVAILABLE;
KeyboardAutoRepeatOn();
old_joystick_status = joystick.status;
joystick.status = JOYSTICK_NOT_AVAILABLE;
- /* simulate key release events for still pressed keys */
- key_joystick_mapping = 0;
- for (i=0; i<MAX_PLAYERS; i++)
- stored_player[i].action = 0;
+ ClearPlayerAction();
}
else if (event->type == EVENT_FOCUSIN)
{
}
else if (event->type == EVENT_FOCUSIN)
{
@@
-771,11
+776,9
@@
static int HandleJoystickForAllPlayers()
joy_action = Joystick(i);
result |= joy_action;
joy_action = Joystick(i);
result |= joy_action;
-
if (!setup.input[i].use_joystick)
continue;
if (!setup.input[i].use_joystick)
continue;
-
stored_player[i].action = joy_action;
}
stored_player[i].action = joy_action;
}