summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Macht <hmacht@suse.de>2010-03-09 12:11:22 +0100
committerDanny Kukawka <danny.kukawka@web.de>2010-03-10 10:18:04 +0100
commit05b243e5aa70ee413f135eb383f0ad379bfceee2 (patch)
tree1dbb91ed747bddb365766c859a135c676a758c51
parenta3ea90ad7c3d17888df173ffec84a4798264d88c (diff)
fix SLEEP key for some broken BIOSe
Some BIOSe are broken and create infinite key press events for the sleep key (FN-F5). So ignore all key repeats for the SLEEP key. (bnc#525959)
-rw-r--r--hald/linux/addons/addon-input.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hald/linux/addons/addon-input.c b/hald/linux/addons/addon-input.c
index 1d6fcbcf..0c4cbece 100644
--- a/hald/linux/addons/addon-input.c
+++ b/hald/linux/addons/addon-input.c
@@ -300,6 +300,12 @@ event_io (GIOChannel *channel, GIOCondition condition, gpointer data)
}
}
} else if (input_data->event.type == EV_KEY && key_name[input_data->event.code] != NULL && input_data->event.value) {
+ /* this is a key repeat and should be ignored for the sleep key */
+ if (input_data->event.code == KEY_SLEEP && input_data->event.value == 2) {
+ HAL_INFO (("key release event for KEY_SLEEP, ignoring"));
+ return TRUE;
+ }
+
libhal_device_emit_condition (ctx, input_data->udi,
"ButtonPressed",
key_name[input_data->event.code],