summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kurtz <djkurtz@google.com>2011-04-01 16:51:08 +0800
committerPeter Hutterer <peter.hutterer@who-t.net>2011-04-04 08:35:20 +1000
commit6198725ff5626b47c8689030058e2e339f50ba62 (patch)
tree92bd43a80adaafa12436871d058cf70cdcceb40e
parent7b05936ea01271fdfb4b04fb18cac47f2216c5b7 (diff)
Add support for EV_SW
EV_SW is the event type for switches. The EV_SW event codes (SW_*) are defined in the linux kernel in linux/input.h. However, leave the definition of switches in ifdef blocks according to when they were committed to the linux kernel. Signed-off-by: Daniel Kurtz <djkurtz@google.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--evtest.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/evtest.c b/evtest.c
index 4b3890b..62a26fa 100644
--- a/evtest.c
+++ b/evtest.c
@@ -74,7 +74,7 @@ char *events[EV_MAX + 1] = {
[EV_MSC] = "Misc", [EV_LED] = "LED",
[EV_SND] = "Sound", [EV_REP] = "Repeat",
[EV_FF] = "ForceFeedback", [EV_PWR] = "Power",
- [EV_FF_STATUS] = "ForceFeedbackStatus",
+ [EV_FF_STATUS] = "ForceFeedbackStatus", [EV_SW] = "Switch",
};
char *keys[KEY_MAX + 1] = {
@@ -425,12 +425,36 @@ char *syns[3] = {
#endif
};
+char *switches[SW_MAX + 1] = {
+ [0 ... SW_MAX] = NULL,
+ [SW_LID] = "Lid",
+ [SW_TABLET_MODE] = "Tablet Mode",
+ [SW_HEADPHONE_INSERT] = "Headphone Insert",
+ [SW_RFKILL_ALL] = "RFKILL",
+ [SW_MICROPHONE_INSERT] = "Microphone Insert",
+ [SW_DOCK] = "Dock",
+ [SW_LINEOUT_INSERT] = "Lineout Insert",
+ [SW_JACK_PHYSICAL_INSERT] = "Jack Physical Insert",
+#ifdef SW_VIDEOOUT_INSERT
+ [SW_VIDEOOUT_INSERT] = "Video Out Insert",
+#endif
+#ifdef SW_CAMERA_LENS_COVER
+ [SW_CAMERA_LENS_COVER] = "Camera Lens Cover",
+ [SW_KEYPAD_SLIDE] = "Keypad Slide",
+ [SW_FRONT_PROXIMITY] = "Front Proximity Sensor",
+#endif
+#ifdef SW_ROTATE_LOCK
+ [SW_ROTATE_LOCK] = "Rotate Lock",
+#endif
+};
+
char **names[EV_MAX + 1] = {
[0 ... EV_MAX] = NULL,
[EV_SYN] = events, [EV_KEY] = keys,
[EV_REL] = relatives, [EV_ABS] = absolutes,
[EV_MSC] = misc, [EV_LED] = leds,
[EV_SND] = sounds, [EV_REP] = repeats,
+ [EV_SW] = switches,
};
/**