summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2009-06-26 09:38:04 +0200
committerMartin Pitt <martin.pitt@ubuntu.com>2009-06-26 09:38:04 +0200
commit337ca70b39ce9477a01b97e990ad731ca13ad664 (patch)
tree4e9cab8bf27c0b489f3c217d00205fb7f5e637eb
parent1cbaa7b9deac469d4a809f2b5f6ac1063d3370cc (diff)
add input.keys capability to input buttons
Add input.keys capability to button input devices which support key events, such as the power, sleep, hibernate, and "lid" buttons. This causes them to be picked up by 10-x11-input.fdi and propagated to things like gnome-power-manager. Taken from http://cvs.fedoraproject.org/viewvc/devel/hal/hal-add-keys-to-buttons.patch?revision=1.1&view=markup http://bugzilla.gnome.org/show_bug.cgi?id=581363 https://launchpad.net/bugs/384890
-rw-r--r--hald/linux/device.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hald/linux/device.c b/hald/linux/device.c
index 02c456f7..653c9fe0 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -1006,6 +1006,8 @@ input_test_key (HalDevice *d, const char *sysfs_path)
} else if (test_bit (KEY_SUSPEND, bitmask)) {
hal_device_property_set_string (d, "button.type", "hibernate");
}
+ if (input_test_keys (bitmask))
+ hal_device_add_capability (d, "input.keys");
} else {
gboolean is_keyboard = input_test_keyboard (bitmask);
gboolean is_keypad = input_test_keypad (bitmask);