summaryrefslogtreecommitdiff
path: root/apps/plugins/rockboy/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/rockboy/events.c')
-rw-r--r--apps/plugins/rockboy/events.c45
1 files changed, 15 insertions, 30 deletions
diff --git a/apps/plugins/rockboy/events.c b/apps/plugins/rockboy/events.c
index 5a34ce81e5..c018f7ce53 100644
--- a/apps/plugins/rockboy/events.c
+++ b/apps/plugins/rockboy/events.c
@@ -8,10 +8,6 @@
#include "rockmacros.h"
#include "input.h"
-
-char keystates[MAX_KEYS];
-int nkeysdown;
-
#define MAX_EVENTS 32
static event_t eventqueue[MAX_EVENTS];
@@ -20,34 +16,23 @@ static int eventhead, eventpos;
int ev_postevent(event_t *ev)
{
- int nextevent;
- nextevent = (eventhead+1)%MAX_EVENTS;
- if (nextevent == eventpos)
- return 0;
- eventqueue[eventhead] = *ev;
- eventhead = nextevent;
- return 1;
+ int nextevent;
+ nextevent = (eventhead+1)%MAX_EVENTS;
+ if (nextevent == eventpos)
+ return 0;
+ eventqueue[eventhead] = *ev;
+ eventhead = nextevent;
+ return 1;
}
int ev_getevent(event_t *ev)
{
- if (eventpos == eventhead)
- {
- ev->type = EV_NONE;
- return 0;
- }
- *ev = eventqueue[eventpos];
- eventpos = (eventpos+1)%MAX_EVENTS;
- if (ev->type == EV_PRESS)
- {
- keystates[ev->code] = 1;
- nkeysdown++;
- }
- if (ev->type == EV_RELEASE)
- {
- keystates[ev->code] = 0;
- nkeysdown--;
- if (nkeysdown < 0) nkeysdown = 0;
- }
- return 1;
+ if (eventpos == eventhead)
+ {
+ ev->type = EV_NONE;
+ return 0;
+ }
+ *ev = eventqueue[eventpos];
+ eventpos = (eventpos+1)%MAX_EVENTS;
+ return 1;
}