aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2021-08-05 04:09:39 +0900
committerKazuki Yamaguchi <k@rhe.jp>2021-08-06 02:36:43 +0900
commit012d28407a2175f084a30b674e323e0b1983857d (patch)
treeebfa6e3e5cd02204f653ba1e9fdf5caef65539ea
parentb6ef8039c18eb384820376433d253fa0c5d70514 (diff)
downloadthotkeys-012d28407a2175f084a30b674e323e0b1983857d.tar.gz
relax duplicate device name checking
My Logitech G502 has two "Logitech Gaming Mouse G502 Keyboard" - one as a slave keyboard and another as a slave pointer. The latter is irrelevant here and can be ignored.
-rw-r--r--thotkeys.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/thotkeys.c b/thotkeys.c
index 61f5975..3daf3fd 100644
--- a/thotkeys.c
+++ b/thotkeys.c
@@ -60,11 +60,11 @@ static XDeviceInfo *get_device_info(Display *display, const char *name)
for (int i = 0; i < num_devices; i++) {
XDeviceInfo *device = &devices[i];
- if (device->use < IsXExtensionDevice)
+ if (device->use != IsXExtensionKeyboard)
continue;
if (!strcmp(device->name, name) || use_id && (long)device->id == id) {
if (found)
- fatal("more than one device found with the " \
+ fatal("more than one keyboard found with the " \
"name '%s'\n", name);
found = device;
}