after talking on the phone with Axel how to fix this driver's repeat key problem,

I found a simpler and actually correct way to fix it...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21187 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2007-05-21 14:51:07 +00:00
parent af68bb5564
commit 2fb3526f33
1 changed files with 4 additions and 10 deletions

View File

@ -414,7 +414,6 @@ interpret_kb_buffer(hid_device_info *device)
{ {
uint8 modifiers = ((uint8*)device->buffer)[0]; uint8 modifiers = ((uint8*)device->buffer)[0];
uint8 bits = device->last_buffer[0] ^ modifiers; uint8 bits = device->last_buffer[0] ^ modifiers;
bool timerSet = false;
uint32 i, j; uint32 i, j;
if (bits) { if (bits) {
@ -447,7 +446,6 @@ interpret_kb_buffer(hid_device_info *device)
// unmapped key // unmapped key
key = 0x200000 + ((uint8*)device->buffer)[i]; key = 0x200000 + ((uint8*)device->buffer)[i];
} }
//dprintf("key down: %x, mapping: %lx\n", ((uint8*)device->buffer)[i], key);
write_key(device, key, true); write_key(device, key, true);
@ -456,7 +454,6 @@ interpret_kb_buffer(hid_device_info *device)
device->repeat_timer.key = key; device->repeat_timer.key = key;
add_timer(&device->repeat_timer.timer, timer_delay_hook, add_timer(&device->repeat_timer.timer, timer_delay_hook,
device->repeat_delay, B_ONE_SHOT_RELATIVE_TIMER); device->repeat_delay, B_ONE_SHOT_RELATIVE_TIMER);
timerSet = true;
} }
} else } else
break; break;
@ -488,7 +485,7 @@ interpret_kb_buffer(hid_device_info *device)
} }
write_key(device, key, false); write_key(device, key, false);
if (!timerSet) if (device->repeat_timer.key == key)
cancel_timer(&device->repeat_timer.timer); cancel_timer(&device->repeat_timer.timer);
} }
} else } else
@ -664,15 +661,12 @@ hid_device_added(const usb_device *dev, void **cookie)
dev_desc = usb->get_device_descriptor(dev); dev_desc = usb->get_device_descriptor(dev);
if (dev_desc->vendor_id == USB_VENDOR_WACOM) {
DPRINTF_INFO ((MY_ID "vendor ID 0x%04X, product ID 0x%04X\n",
dev_desc->vendor_id, dev_desc->product_id));
return B_ERROR;
}
DPRINTF_INFO ((MY_ID "vendor ID 0x%04X, product ID 0x%04X\n", DPRINTF_INFO ((MY_ID "vendor ID 0x%04X, product ID 0x%04X\n",
dev_desc->vendor_id, dev_desc->product_id)); dev_desc->vendor_id, dev_desc->product_id));
if (dev_desc->vendor_id == USB_VENDOR_WACOM)
return B_ERROR;
/* check interface class */ /* check interface class */
if ((conf = usb->get_nth_configuration(dev, DEFAULT_CONFIGURATION)) == NULL) { if ((conf = usb->get_nth_configuration(dev, DEFAULT_CONFIGURATION)) == NULL) {