summarylogtreecommitdiffstats
path: root/new_kernel.patch
blob: 8c4d39d516938c2e17a4bb64a5be09826f5fde55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/evdev.c b/src/evdev.c
index 650be6b..d53cef3 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -323,8 +323,14 @@ static int ahmTimedOutP(long int lastSec, long int lastUsec, struct input_event
     return 0;
   }
 
-  if( (ev->time.tv_sec - lastSec) * 1000
-      + (ev->time.tv_usec - lastUsec) / 1000
+  /* Seems like in newer kernels (>= 5.5), the timestamp of a key release
+     is that of the press event */
+
+  struct timeval tv;
+  gettimeofday(&tv, NULL);
+
+  if( (tv.tv_sec - lastSec) * 1000
+      + (tv.tv_usec - lastUsec) / 1000
       > timeOut){
     return 1;
   }else{