Do not load virtual keyboards in tsak

This resolves Bug 1275
(cherry picked from commit 8d2f9ae315)
v3.5.13-sru
Timothy Pearson 11 years ago committed by Slávek Banko
parent eb1b42efff
commit e131fb6f79

@ -234,11 +234,16 @@ int find_keyboards() {
// Ensure that we do not detect our own tsak faked keyboards // Ensure that we do not detect our own tsak faked keyboards
ioctl (fd, EVIOCGNAME(sizeof(name)), name); ioctl (fd, EVIOCGNAME(sizeof(name)), name);
if (str_ends_with(name, "+tsak") == 0) { if (str_ends_with(name, "+tsak") == 0) {
/* We assume that anything that has an alphabetic key in the // Do not attempt to use virtual keyboards per Bug 1275
QWERTYUIOP range in it is the main keyboard. */ struct input_id input_info;
for (j = KEY_Q; j <= KEY_P; j++) { ioctl (fd, EVIOCGID, &input_info);
if (TestBit(j, key_bitmask)) { if ((input_info.vendor != 0) && (input_info.product != 0)) {
keyboard_fds[keyboard_fd_num] = fd; /* We assume that anything that has an alphabetic key in the
QWERTYUIOP range in it is the main keyboard. */
for (j = KEY_Q; j <= KEY_P; j++) {
if (TestBit(j, key_bitmask)) {
keyboard_fds[keyboard_fd_num] = fd;
}
} }
} }
} }

Loading…
Cancel
Save