projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b2a3b2f
)
fixed sending button press/release events to animation event handling
author
Holger Schemel
<info@artsoft.org>
Tue, 13 Jun 2023 21:22:10 +0000
(23:22 +0200)
committer
Holger Schemel
<info@artsoft.org>
Tue, 13 Jun 2023 21:22:10 +0000
(23:22 +0200)
src/events.c
patch
|
blob
|
history
diff --git
a/src/events.c
b/src/events.c
index e03f58f9b942b80c3c3f204eb7f2c8af9e71d245..648b035f0a9e1702dfa22fc5cfe30aed15fdca4e 100644
(file)
--- a/
src/events.c
+++ b/
src/events.c
@@
-2614,12
+2614,15
@@
void HandleJoystick(void)
int up = joy & JOY_UP;
int down = joy & JOY_DOWN;
int button = joy & JOY_BUTTON;
int up = joy & JOY_UP;
int down = joy & JOY_DOWN;
int button = joy & JOY_BUTTON;
- int newbutton = (AnyJoystickButton() == JOY_BUTTON_NEW_PRESSED);
+ int anybutton = AnyJoystickButton();
+ int newbutton = (anybutton == JOY_BUTTON_NEW_PRESSED);
int dx = (left ? -1 : right ? 1 : 0);
int dy = (up ? -1 : down ? 1 : 0);
boolean use_delay_value_first = (joytest != joytest_last);
int dx = (left ? -1 : right ? 1 : 0);
int dy = (up ? -1 : down ? 1 : 0);
boolean use_delay_value_first = (joytest != joytest_last);
+ boolean new_button_event = (anybutton == JOY_BUTTON_NEW_PRESSED ||
+ anybutton == JOY_BUTTON_NEW_RELEASED);
- if (HandleGlobalAnimClicks(-1, -1, newbutton, FALSE))
+ if (
new_button_event &&
HandleGlobalAnimClicks(-1, -1, newbutton, FALSE))
{
// do not handle this button event anymore
return;
{
// do not handle this button event anymore
return;