From e654ed62d44b8d61484f97eab1b1adbfb08d375f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 12 Jun 2008 11:52:29 +1000 Subject: [PATCH] config: disable evdev for keyboards --- config/hal.c | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/config/hal.c b/config/hal.c index f4eb438..ee0f18f 100644 --- a/config/hal.c +++ b/config/hal.c @@ -168,6 +168,31 @@ get_prop_string_array(LibHalContext *hal_ctx, const char *udi, const char *prop) } #endif +static Bool +get_device_is_keyboard(LibHalContext *hal_ctx, const char *udi, DBusError *error_p) +{ + char **props; + int i; + Bool ret = FALSE; + + props = libhal_device_get_property_strlist(hal_ctx, udi, + "info.capabilities", error_p); + if (!props) { + return FALSE; + } + for (i = 0; props[i]; i++) { + if (strcmp(props[i], "input.keys") == 0 || + strcmp(props[i], "input.keyboard") == 0) { + ret = TRUE; + goto out_error; + } + } + +out_error: + libhal_free_string_array(props); + return ret; +} + static void device_added(LibHalContext *hal_ctx, const char *udi) { @@ -184,6 +209,9 @@ device_added(LibHalContext *hal_ctx, const char *udi) dbus_error_init(&error); + if (get_device_is_keyboard(hal_ctx, udi, &error)) + goto unwind; + driver = get_prop_string(hal_ctx, udi, "input.x11_driver"); if (!driver){ /* verbose, don't tell the user unless they _want_ to see it */ -- 1.5.3.7