&device->base,
time,
e->code,
- e->value ? LIBINPUT_KEYBOARD_KEY_STATE_PRESSED :
- LIBINPUT_KEYBOARD_KEY_STATE_RELEASED);
+ e->value ? LIBINPUT_KEY_STATE_PRESSED :
+ LIBINPUT_KEY_STATE_RELEASED);
break;
}
}
keyboard_notify_key(struct libinput_device *device,
uint32_t time,
uint32_t key,
- enum libinput_keyboard_key_state state);
+ enum libinput_key_state state);
void
pointer_notify_motion(struct libinput_device *device,
uint32_t time;
uint32_t key;
uint32_t seat_key_count;
- enum libinput_keyboard_key_state state;
+ enum libinput_key_state state;
};
struct libinput_event_pointer {
return event->key;
}
-LIBINPUT_EXPORT enum libinput_keyboard_key_state
+LIBINPUT_EXPORT enum libinput_key_state
libinput_event_keyboard_get_key_state(struct libinput_event_keyboard *event)
{
return event->state;
static uint32_t
update_seat_key_count(struct libinput_seat *seat,
int32_t key,
- enum libinput_keyboard_key_state state)
+ enum libinput_key_state state)
{
assert(key >= 0 && key <= KEY_MAX);
switch (state) {
- case LIBINPUT_KEYBOARD_KEY_STATE_PRESSED:
+ case LIBINPUT_KEY_STATE_PRESSED:
return ++seat->button_count[key];
- case LIBINPUT_KEYBOARD_KEY_STATE_RELEASED:
+ case LIBINPUT_KEY_STATE_RELEASED:
/* We might not have received the first PRESSED event. */
if (seat->button_count[key] == 0)
return 0;
keyboard_notify_key(struct libinput_device *device,
uint32_t time,
uint32_t key,
- enum libinput_keyboard_key_state state)
+ enum libinput_key_state state)
{
struct libinput_event_keyboard *key_event;
uint32_t seat_key_count;
* Logical state of a key. Note that the logical state may not represent
* the physical state of the key.
*/
-enum libinput_keyboard_key_state {
- LIBINPUT_KEYBOARD_KEY_STATE_RELEASED = 0,
- LIBINPUT_KEYBOARD_KEY_STATE_PRESSED = 1
+enum libinput_key_state {
+ LIBINPUT_KEY_STATE_RELEASED = 0,
+ LIBINPUT_KEY_STATE_PRESSED = 1
};
/**
*
* @return The state change of the key
*/
-enum libinput_keyboard_key_state
+enum libinput_key_state
libinput_event_keyboard_get_key_state(struct libinput_event_keyboard *event);
ck_assert_notnull(kev);
ck_assert_int_eq(libinput_event_keyboard_get_key(kev), KEY_A);
ck_assert_int_eq(libinput_event_keyboard_get_key_state(kev),
- LIBINPUT_KEYBOARD_KEY_STATE_PRESSED);
+ LIBINPUT_KEY_STATE_PRESSED);
++expected_key_button_count;
seat_key_count =
ck_assert_notnull(kev);
ck_assert_int_eq(libinput_event_keyboard_get_key(kev), KEY_A);
ck_assert_int_eq(libinput_event_keyboard_get_key_state(kev),
- LIBINPUT_KEYBOARD_KEY_STATE_RELEASED);
+ LIBINPUT_KEY_STATE_RELEASED);
--expected_key_button_count;
seat_key_count =
print_key_event(struct libinput_event *ev)
{
struct libinput_event_keyboard *k = libinput_event_get_keyboard_event(ev);
- enum libinput_keyboard_key_state state;
+ enum libinput_key_state state;
print_event_time(libinput_event_keyboard_get_time(k));
state = libinput_event_keyboard_get_key_state(k);
printf("%d %s\n",
libinput_event_keyboard_get_key(k),
- state == LIBINPUT_KEYBOARD_KEY_STATE_PRESSED ? "pressed" : "released");
+ state == LIBINPUT_KEY_STATE_PRESSED ? "pressed" : "released");
}
static void