projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20060815-2-src
[rocksndiamonds.git]
/
src
/
events.c
diff --git
a/src/events.c
b/src/events.c
index d78ff4a9439738cbed3df5234bb28c7d33085765..3e159dc4740db50ef0a85b3f8ca317946233a52f 100644
(file)
--- a/
src/events.c
+++ b/
src/events.c
@@
-315,6
+315,11
@@
void HandleExposeEvent(ExposeEvent *event)
void HandleButtonEvent(ButtonEvent *event)
{
void HandleButtonEvent(ButtonEvent *event)
{
+#if 0
+ printf("::: BUTTON EVENT: button %d %s\n", event->button,
+ event->type == EVENT_BUTTONPRESS ? "pressed" : "released");
+#endif
+
motion_status = FALSE;
if (event->type == EVENT_BUTTONPRESS)
motion_status = FALSE;
if (event->type == EVENT_BUTTONPRESS)
@@
-345,6
+350,11
@@
void HandleKeyEvent(KeyEvent *event)
Key key = GetEventKey(event, with_modifiers);
Key keymod = (with_modifiers ? GetEventKey(event, FALSE) : key);
Key key = GetEventKey(event, with_modifiers);
Key keymod = (with_modifiers ? GetEventKey(event, FALSE) : key);
+#if 0
+ printf("::: KEY EVENT: %d %s\n", GetEventKey(event, TRUE),
+ event->type == EVENT_KEYPRESS ? "pressed" : "released");
+#endif
+
HandleKeyModState(keymod, key_status);
HandleKey(key, key_status);
}
HandleKeyModState(keymod, key_status);
HandleKey(key, key_status);
}
@@
-419,7
+429,7
@@
void HandleButton(int mx, int my, int button, int button_nr)
}
/* do not use scroll wheel button events for anything other than gadgets */
}
/* do not use scroll wheel button events for anything other than gadgets */
- if (
button_nr > 3
)
+ if (
IS_WHEEL_BUTTON(button_nr)
)
return;
switch (game_status)
return;
switch (game_status)
@@
-677,12
+687,26
@@
void HandleKey(Key key, int key_status)
if (key_status == KEY_RELEASED)
return;
if (key_status == KEY_RELEASED)
return;
+ if ((key == KSYM_Return || key == KSYM_KP_Enter) &&
+ (GetKeyModState() & KMOD_Alt) && video.fullscreen_available)
+ {
+ setup.fullscreen = !setup.fullscreen;
+
+ ToggleFullscreenIfNeeded();
+
+ return;
+ }
+
if (game_status == GAME_MODE_PLAYING && AllPlayersGone &&
(key == KSYM_Return || key == setup.shortcut.toggle_pause))
{
if (game_status == GAME_MODE_PLAYING && AllPlayersGone &&
(key == KSYM_Return || key == setup.shortcut.toggle_pause))
{
+#if 1
+ GameEnd();
+#else
CloseDoor(DOOR_CLOSE_1);
game_status = GAME_MODE_MAIN;
DrawMainMenu();
CloseDoor(DOOR_CLOSE_1);
game_status = GAME_MODE_MAIN;
DrawMainMenu();
+#endif
return;
}
return;
}
@@
-1045,9
+1069,14
@@
void HandleJoystick()
if (AllPlayersGone && newbutton)
{
if (AllPlayersGone && newbutton)
{
+#if 1
+ GameEnd();
+#else
CloseDoor(DOOR_CLOSE_1);
game_status = GAME_MODE_MAIN;
DrawMainMenu();
CloseDoor(DOOR_CLOSE_1);
game_status = GAME_MODE_MAIN;
DrawMainMenu();
+#endif
+
return;
}
return;
}