aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--marsond.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/marsond.c b/marsond.c
index 8ce061c..59c2fee 100644
--- a/marsond.c
+++ b/marsond.c
@@ -352,6 +352,15 @@ void release_key(int code) {
write_event(&ev);
}
+const char *event_type(int type) {
+ switch(type) {
+ case EV_SYN: return "EV_SYN";
+ case EV_MSC: return "EV_MSC";
+ case EV_KEY: return "EV_KEY";
+ default: return "???";
+ }
+}
+
void shift_timing(long long *last, const char *name, int code) {
if(*last && (gettime_millis() < (*last + shift_ms))) {
debug_fg("!!! Enter pressed; last %s shift press < %dms ago, sending %s shift release", name, shift_ms, name);
@@ -461,8 +470,8 @@ int main(int argc, char **argv) {
}
}
- debug_fg("got event: type %d, code 0x%02x, value %d",
- ev.type, ev.code, ev.value);
+ debug_fg("got event: type %d (%s), code 0x%02x, value %d",
+ ev.type, event_type(ev.type), ev.code, ev.value);
/* ev.value: 0 == release, 1 == initial press, 2 == repeat */
if(ev.type == EV_KEY) {