input: add features mechanism
[platform/upstream/kmscon.git] / src / input.h
index 9b70e31..d8029ad 100644 (file)
@@ -49,6 +49,7 @@
 #define KMSCON_INPUT_H
 
 #include <inttypes.h>
+#include <limits.h>
 #include <stdbool.h>
 #include "eloop.h"
 
@@ -89,4 +90,10 @@ void kmscon_input_sleep(struct kmscon_input *input);
 void kmscon_input_wake_up(struct kmscon_input *input);
 bool kmscon_input_is_asleep(struct kmscon_input *input);
 
+/* Querying the results of evdev ioctl's. Also used by kbd backends. */
+static inline bool kmscon_evdev_bit_is_set(const unsigned long *array, int bit)
+{
+       return !!(array[bit / LONG_BIT] & (1LL << (bit % LONG_BIT)));
+}
+
 #endif /* KMSCON_INPUT_H */