projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed repeatedly toggling fullscreen mode by repeated 'key press' events
[rocksndiamonds.git]
/
src
/
events.c
diff --git
a/src/events.c
b/src/events.c
index d9104aa1be04172a8d64bc8be39b3afd8c57fb46..e371b63455b1384f0762765c6269bdf1850b1650 100644
(file)
--- a/
src/events.c
+++ b/
src/events.c
@@
-1159,6
+1159,7
@@
static void HandleKeysSpecial(Key key)
void HandleKey(Key key, int key_status)
{
boolean anyTextGadgetActiveOrJustFinished = anyTextGadgetActive();
void HandleKey(Key key, int key_status)
{
boolean anyTextGadgetActiveOrJustFinished = anyTextGadgetActive();
+ static boolean ignore_repeated_key = FALSE;
static struct SetupKeyboardInfo ski;
static struct SetupShortcutInfo ssi;
static struct
static struct SetupKeyboardInfo ski;
static struct SetupShortcutInfo ssi;
static struct
@@
-1326,12
+1327,18
@@
void HandleKey(Key key, int key_status)
key_joystick_mapping = 0;
if (key_status == KEY_RELEASED)
key_joystick_mapping = 0;
if (key_status == KEY_RELEASED)
+ {
+ // reset flag to ignore repeated "key pressed" events after key release
+ ignore_repeated_key = FALSE;
+
return;
return;
+ }
if ((key == KSYM_F11 ||
((key == KSYM_Return ||
key == KSYM_KP_Enter) && (GetKeyModState() & KMOD_Alt))) &&
if ((key == KSYM_F11 ||
((key == KSYM_Return ||
key == KSYM_KP_Enter) && (GetKeyModState() & KMOD_Alt))) &&
- video.fullscreen_available)
+ video.fullscreen_available &&
+ !ignore_repeated_key)
{
setup.fullscreen = !setup.fullscreen;
{
setup.fullscreen = !setup.fullscreen;
@@
-1340,6
+1347,9
@@
void HandleKey(Key key, int key_status)
if (game_status == GAME_MODE_SETUP)
RedrawSetupScreenAfterFullscreenToggle();
if (game_status == GAME_MODE_SETUP)
RedrawSetupScreenAfterFullscreenToggle();
+ // set flag to ignore repeated "key pressed" events
+ ignore_repeated_key = TRUE;
+
return;
}
return;
}