* Its use should be as simple as the following (but also see below):
* - Create a new input object.
* - Provide a callback function to receive the events.
- * - Connect the input object to a kmscon_eloop.
+ * - Connect the input object to a ev_eloop.
* - Wake up the input object to begin receiving input events through the
* event loop.
*
#define KMSCON_INPUT_H
#include <inttypes.h>
+#include <limits.h>
#include <stdbool.h>
#include "eloop.h"
void kmscon_input_unref(struct kmscon_input *input);
int kmscon_input_connect_eloop(struct kmscon_input *input,
- struct kmscon_eloop *eloop, kmscon_input_cb cb, void *data);
+ struct ev_eloop *eloop, kmscon_input_cb cb, void *data);
void kmscon_input_disconnect_eloop(struct kmscon_input *input);
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 */