My mouse has delusions of keyboard-ness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've had a problem for quite a while, that my Logitech MouseManPlusPS/2 mouse
(Cordless, optical, all singing, all dancing crap of a mouse.) seems to think
it is a keyboard.  When I use the mouse buttons, I they work, but they also
produce the capitol letters QWER as if I typed them.  X doesn't see this
effect, but gpm does.

This is a USB mouse.  The keys it claims to have appear to be for control
of music and such.  I have not seen any evidence of these extra buttons.

They keyboard also has www, mail, and search buttons that seem to
produce mouse events, but I'm not too concerned about that.

Anyway, if I change the kbd_connect function as shown below, to have
a vi bigot's definition of keyboard, all is well.  But I don't really
want to patch the kernel once a month for the rest of my life, and I
don't know how many people that patch would break ... but I'm guessing
that there are more devices on heaven and earth that SHOULD be identified
as keyboards than are dreamt of in my philosophy.

Also, I'm not sure what would be happening if things were working really
well ... would the keyboard driver like my mouse, and teach it new
tricks, or should mice and men just not mix that way?

Also, was there a reason to check every possible key in the old code?
I cannot imagine that there are many keyboards running around with
only a single lonely colon key.  

Regards,
Rich

//###
//###  Note: the following code will probably annoy anyone who runs
//###        it.  I disclaim all responsibility for such annoyance.
//###
|   // definition:
|	// keyboard: (n) a thing you can use to start vi
|
|static struct input_handle *kbd_connect(struct input_handler *handler, 
|					struct input_dev *dev,
|					struct input_device_id *id)
|{
|	struct input_handle *handle;
|	int i;
|
|	if (test_bit(KEY_V, dev->keybit) && test_bit(KEY_I, dev->keybit))
|		i=KEY_V;
|	else
|		i=BTN_MISC;
|
|	if ((i == BTN_MISC) && !test_bit(EV_SND, dev->evbit)) 
|		return NULL;
|
|	if (!(handle = kmalloc(sizeof(struct input_handle), GFP_KERNEL))) 
|		return NULL;
|	memset(handle, 0, sizeof(struct input_handle));
|
|	handle->dev = dev;
|	handle->handler = handler;
|	handle->name = kbd_name;
|
|	input_open_device(handle);
|	kbd_refresh_leds(handle);
|
|	return handle;
|}

|static struct input_handle *kbd_connect(struct input_handler *handler, 
|					struct input_dev *dev,
|					struct input_device_id *id)
|{
|	struct input_handle *handle;
|	int i;
|
|	for (i = KEY_RESERVED; i < BTN_MISC; i++)
|		if (test_bit(i, dev->keybit)) break;
|
|	if ((i == BTN_MISC) && !test_bit(EV_SND, dev->evbit)) 
|		return NULL;
|
|	if (!(handle = kmalloc(sizeof(struct input_handle), GFP_KERNEL))) 
|		return NULL;
|	memset(handle, 0, sizeof(struct input_handle));
|
|	handle->dev = dev;
|	handle->handler = handler;
|	handle->name = kbd_name;
|
|	input_open_device(handle);
|	kbd_refresh_leds(handle);
|
|	return handle;
|}

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux