[PATCH libinput 07/17] evdev: prefix the hw key/button bitmask with 'hw'

Peter Hutterer peter.hutterer at who-t.net
Tue Sep 2 19:02:58 PDT 2014


This bitmask reflects the hw state, prefix it accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev.c | 12 ++++++------
 src/evdev.h |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 721238f..71c5236 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -48,15 +48,15 @@ enum evdev_key_type {
 };
 
 static void
-set_key_down(struct evdev_device *device, int code, int pressed)
+hw_set_key_down(struct evdev_device *device, int code, int pressed)
 {
-	long_set_bit_state(device->key_mask, code, pressed);
+	long_set_bit_state(device->hw_key_mask, code, pressed);
 }
 
 static int
-is_key_down(struct evdev_device *device, int code)
+hw_is_key_down(struct evdev_device *device, int code)
 {
-	return long_bit_is_set(device->key_mask, code);
+	return long_bit_is_set(device->hw_key_mask, code);
 }
 
 static int
@@ -385,12 +385,12 @@ evdev_process_key(struct evdev_device *device,
 			break;
 		case EVDEV_KEY_TYPE_KEY:
 		case EVDEV_KEY_TYPE_BUTTON:
-			if (!is_key_down(device, e->code))
+			if (!hw_is_key_down(device, e->code))
 				return;
 		}
 	}
 
-	set_key_down(device, e->code, e->value);
+	hw_set_key_down(device, e->code, e->value);
 
 	switch (type) {
 	case EVDEV_KEY_TYPE_NONE:
diff --git a/src/evdev.h b/src/evdev.h
index 50ca713..9de44bc 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -100,7 +100,7 @@ struct evdev_device {
 
 	/* Bitmask of pressed keys used to ignore initial release events from
 	 * the kernel. */
-	unsigned long key_mask[NLONGS(KEY_CNT)];
+	unsigned long hw_key_mask[NLONGS(KEY_CNT)];
 	/* Key counter used for multiplexing button events internally in
 	 * libinput. */
 	uint8_t key_count[KEY_CNT];
-- 
1.9.3



More information about the wayland-devel mailing list