[PATCH] ati_remote2 autorepeat and loadable keymap support

STALE6773d

22 messages, 4 authors, 2008-04-07 · open the first message on its own page

[PATCH] ati_remote2 autorepeat and loadable keymap support

From: Peter Stokes <hidden>
Date: 2008-02-16 16:22:49

The attached patch reconfigures the ati_remote2 driver to use soft-autorepeat 
functionality and adds support for loadable key maps.

I have reconfigure the driver to use the input system's built-in autorepeat 
functionality as the device only appears to be able to produce key repeat 
notifications at a fixed period. Switching to the software autorepeat 
functionality provides more precise configuration of the timings requested 
for repeat-delay and repeat-rate.

As this device is exposed as a combined keyboard and mouse, this change 
somewhat depends upon the suggested modification to the core soft-autorepeat 
functionality as outlined in my previous post to the linux-input mailing list 
(on 12th Feb 2008 entitled "Soft-autorepeat functionality"), without that 
modification, the mouse buttons are autorepeated :-(

The loadable keymap support exposes the ability to map 5 separate keycodes to 
each key (depending on which "mode" the remote control is currently in). 
Additionally, I have attempted to ensure that the scancodes used to map 
keycodes to the keys lie outside of the range normally covered by regular 
keyboards so as to avoid requests to remap the keys on the remote from being 
intercepted by a normal keyboard.

Any feedback would be gratefully received.

Thanks in advance.

Peter Stokes

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Jiri Kosina <hidden>
Date: 2008-03-03 22:54:20

On Sat, 16 Feb 2008, Peter Stokes wrote:
As this device is exposed as a combined keyboard and mouse, this change 
somewhat depends upon the suggested modification to the core 
soft-autorepeat functionality as outlined in my previous post to the 
linux-input mailing list (on 12th Feb 2008 entitled "Soft-autorepeat 
functionality"), without that modification, the mouse buttons are 
autorepeated :-(
I don't think that the solution you proposed in that mail, i.e.
--- linux-2.6.24-orig/drivers/input/input.c	2008-01-24 22:58:37.000000000 +0000
+++ linux-2.6.24/drivers/input/input.c	2008-02-11 20:02:03.000000000 +0000
@@ -123,6 +123,7 @@
 static void input_start_autorepeat(struct input_dev *dev, int code)
 {
 	if (test_bit(EV_REP, dev->evbit) &&
+	    code < KEY_MIN_INTERESTING &&
 	    dev->rep[REP_PERIOD] && dev->rep[REP_DELAY] &&
 	    dev->timer.data) {
 		dev->repeat_key = code;
should be used. We really can't generally assume that there is no key 
above KEY_MIN_INTERESTING that shouldn't be autorepeated. The 
KEY_MIN_INTERESTING is, if I remember correctly, just a hack that 
modaliases don't grow excessively.

What about changing the 
ati_remote2-autorepeat-and-loadable-keymap-support.patch (as it is now in 
-mm) so that it registers two independent input devices, one for keyboard 
and one for mouse, and depedning on the type of arriving event, you decide 
which input device to use?

You can then easily set autorepeat only for one of them, right?

Thanks,

-- 
Jiri Kosina
SUSE Labs

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Ville Syrjälä <syrjala@sci.fi>
Date: 2008-03-04 12:47:17

On Sat, Feb 16, 2008 at 04:22:43PM +0000, Peter Stokes wrote:
The attached patch reconfigures the ati_remote2 driver to use soft-autorepeat 
functionality and adds support for loadable key maps.
Why was this submitted (and even accepted) without cc:ing me?
I have reconfigure the driver to use the input system's built-in autorepeat 
functionality as the device only appears to be able to produce key repeat 
notifications at a fixed period. Switching to the software autorepeat 
functionality provides more precise configuration of the timings requested 
for repeat-delay and repeat-rate.
The soft-autorepeat support should be split into a separate patch. I don't
need such fast repeat but if it helps people I'm fine with it.
As this device is exposed as a combined keyboard and mouse, this change 
somewhat depends upon the suggested modification to the core soft-autorepeat 
functionality as outlined in my previous post to the linux-input mailing list 
(on 12th Feb 2008 entitled "Soft-autorepeat functionality"), without that 
modification, the mouse buttons are autorepeated :-(

The loadable keymap support exposes the ability to map 5 separate keycodes to 
each key (depending on which "mode" the remote control is currently in). 
Additionally, I have attempted to ensure that the scancodes used to map 
keycodes to the keys lie outside of the range normally covered by regular 
keyboards so as to avoid requests to remap the keys on the remote from being 
intercepted by a normal keyboard.
I thought the idea of input devices was to reflect the hardware and the
keymaps should be handled in userspace. If that's not the case then I think
the keymap support code should not be inside the driver but instead inside
the input core. We don't want such invasive changes in every driver do
we?

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Jiri Kosina <hidden>
Date: 2008-03-04 13:20:30

On Tue, 4 Mar 2008, Ville Syrjälä wrote:
quoted
The attached patch reconfigures the ati_remote2 driver to use soft-autorepeat 
functionality and adds support for loadable key maps.
Why was this submitted (and even accepted) without cc:ing me?
I don't seem to see you in MAINTAINERS entry, so that's probably why you 
didn't receive confirmation when Andrew has put this patch into -mm.

Merging into -mm doesn't mean that the patch is accepted at all, it just 
exposes it for wider audience for feedback and testing.


With respect to autorepeat -- I think that the easiest solution would be 
registering two separate input devices, one for keyboard and one for 
mouse, and perform the switching in the driver, depending on the type of 
received events.

-- 
Jiri Kosina
SUSE Labs

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Ville Syrjälä <syrjala@sci.fi>
Date: 2008-03-04 13:47:52

On Tue, Mar 04, 2008 at 02:20:19PM +0100, Jiri Kosina wrote:
On Tue, 4 Mar 2008, Ville Syrjälä wrote:
quoted
quoted
The attached patch reconfigures the ati_remote2 driver to use soft-autorepeat 
functionality and adds support for loadable key maps.
Why was this submitted (and even accepted) without cc:ing me?
I don't seem to see you in MAINTAINERS entry, so that's probably why you 
didn't receive confirmation when Andrew has put this patch into -mm.
I guess MODULE_AUTHOR() isn't enough then. I'll send a patch for
MAINTAINERS.
Merging into -mm doesn't mean that the patch is accepted at all, it just 
exposes it for wider audience for feedback and testing.


With respect to autorepeat -- I think that the easiest solution would be 
registering two separate input devices, one for keyboard and one for 
mouse, and perform the switching in the driver, depending on the type of 
received events.
Hmm. IIRC I had one USB mouse which also sent repeat events and the
driver didn't seem to filter them out which is why I added checks to
DirectFB's input driver to filter them in user space. Was that a bug
in the usbhid driver or does it depend on the actual hardware? I still
have that mouse so I can re-test the behavior if needed. I guess the
only issue with registering two input devices whould be that user space
might need some way to tell that they are really part of the same
remote.

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Jiri Kosina <hidden>
Date: 2008-03-04 14:01:45

On Tue, 4 Mar 2008, Ville Syrjälä wrote:
quoted
I don't seem to see you in MAINTAINERS entry, so that's probably why you 
didn't receive confirmation when Andrew has put this patch into -mm.
I guess MODULE_AUTHOR() isn't enough then. I'll send a patch for
MAINTAINERS.
I don't know the exact algorithm Andrew uses to send out CCs when patch is 
merged, but MAINTAINERS entry would definitely help.
Hmm. IIRC I had one USB mouse which also sent repeat events and the 
driver didn't seem to filter them out which is why I added checks to 
DirectFB's input driver to filter them in user space. Was that a bug in 
the usbhid driver or does it depend on the actual hardware? I still have 
that mouse so I can re-test the behavior if needed. 
Button events from mice definitely shouldn't be auto-repeated, if they are 
reported probably by the hardware (i.e. HID_UP_BUTTON usage page, 
MOUSE/POINTER application).

If you could recompile your kernel with CONFIG_HID_DEBUG, modprobe the 
'hid' module with 'debug=1' parameter, and send me the output that appears 
in kernel log when you press (and hold) the button, I will look into it.

-- 
Jiri Kosina
SUSE Labs

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Ville Syrjälä <syrjala@sci.fi>
Date: 2008-03-04 14:07:09

On Tue, Mar 04, 2008 at 03:01:44PM +0100, Jiri Kosina wrote:
On Tue, 4 Mar 2008, Ville Syrjälä wrote:
quoted
quoted
I don't seem to see you in MAINTAINERS entry, so that's probably why you 
didn't receive confirmation when Andrew has put this patch into -mm.
I guess MODULE_AUTHOR() isn't enough then. I'll send a patch for
MAINTAINERS.
I don't know the exact algorithm Andrew uses to send out CCs when patch is 
merged, but MAINTAINERS entry would definitely help.
quoted
Hmm. IIRC I had one USB mouse which also sent repeat events and the 
driver didn't seem to filter them out which is why I added checks to 
DirectFB's input driver to filter them in user space. Was that a bug in 
the usbhid driver or does it depend on the actual hardware? I still have 
that mouse so I can re-test the behavior if needed. 
Button events from mice definitely shouldn't be auto-repeated, if they are 
reported probably by the hardware (i.e. HID_UP_BUTTON usage page, 
MOUSE/POINTER application).

If you could recompile your kernel with CONFIG_HID_DEBUG, modprobe the 
'hid' module with 'debug=1' parameter, and send me the output that appears 
in kernel log when you press (and hold) the button, I will look into it.
I'll do that tonight.

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Ville Syrjälä <syrjala@sci.fi>
Date: 2008-03-04 18:40:07

On Tue, Mar 04, 2008 at 03:01:44PM +0100, Jiri Kosina wrote:
On Tue, 4 Mar 2008, Ville Syrjälä wrote:
quoted
Hmm. IIRC I had one USB mouse which also sent repeat events and the 
driver didn't seem to filter them out which is why I added checks to 
DirectFB's input driver to filter them in user space. Was that a bug in 
the usbhid driver or does it depend on the actual hardware? I still have 
that mouse so I can re-test the behavior if needed. 
Button events from mice definitely shouldn't be auto-repeated, if they are 
reported probably by the hardware (i.e. HID_UP_BUTTON usage page, 
MOUSE/POINTER application).

If you could recompile your kernel with CONFIG_HID_DEBUG, modprobe the 
'hid' module with 'debug=1' parameter, and send me the output that appears 
in kernel log when you press (and hold) the button, I will look into it.
I've attached the bzipped log.

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Jiri Kosina <hidden>
Date: 2008-03-04 18:50:57

On Tue, 4 Mar 2008, Ville Syrjälä wrote:
I've attached the bzipped log.
Thanks. So between these two events:

Mar  4 20:14:31 [kernel] hid-debug: input Button.0001 = 1
Mar  4 20:14:31 [kernel] hid-debug: input Button.0002 = 0
Mar  4 20:14:31 [kernel] hid-debug: input Button.0003 = 0
Mar  4 20:14:31 [kernel] hid-debug: input Button.0004 = 0
Mar  4 20:14:31 [kernel] hid-debug: input Button.0005 = 0
Mar  4 20:14:31 [kernel] hid-debug: input GenericDesktop.X = 0
Mar  4 20:14:31 [kernel] hid-debug: input GenericDesktop.Y = 0
Mar  4 20:14:31 [kernel] hid-debug: input GenericDesktop.Wheel = 0
Mar  4 20:14:31 [kernel] hid-debug: input Consumer.HorizontalWheel = 0
Mar  4 20:14:32 [kernel] drivers/hid/hid-core.c: report (size 6) (numbered)
Mar  4 20:14:32 [kernel] drivers/hid/hid-core.c: report 17 (size 5) =  01 01 00 00 00
Mar  4 20:14:32 [kernel] hid-debug: input Button.0001 = 1
Mar  4 20:14:32 [kernel] hid-debug: input Button.0002 = 0
Mar  4 20:14:32 [kernel] hid-debug: input Button.0003 = 0
Mar  4 20:14:32 [kernel] hid-debug: input Button.0004 = 0
Mar  4 20:14:32 [kernel] hid-debug: input Button.0005 = 0
Mar  4 20:14:32 [kernel] hid-debug: input GenericDesktop.X = 1
Mar  4 20:14:32 [kernel] hid-debug: input GenericDesktop.Y = 0
Mar  4 20:14:32 [kernel] hid-debug: input GenericDesktop.Wheel = 0
Mar  4 20:14:32 [kernel] hid-debug: input Consumer.HorizontalWheel = 0
Mar  4 20:14:32 [kernel] drivers/hid/hid-core.c: report (size 4) (numbered)
Mar  4 20:14:32 [kernel] drivers/hid/hid-core.c: report 5 (size 3) =  00 0e 00
Mar  4 20:14:32 [kernel] hid-debug: input ff00.ff0b = 0
Mar  4 20:14:32 [kernel] hid-debug: input ff00.ff0d = 14
Mar  4 20:14:32 [kernel] drivers/hid/hid-core.c: report (size 6) (numbered)
Mar  4 20:14:32 [kernel] drivers/hid/hid-core.c: report 17 (size 5) =  01 01 00 00 00
Mar  4 20:14:32 [kernel] hid-debug: input Button.0001 = 1
Mar  4 20:14:32 [kernel] hid-debug: input Button.0002 = 0
Mar  4 20:14:32 [kernel] hid-debug: input Button.0003 = 0
Mar  4 20:14:32 [kernel] hid-debug: input Button.0004 = 0
Mar  4 20:14:32 [kernel] hid-debug: input Button.0005 = 0

you got autorepeated Key.LeftBtn?

-- 
Jiri Kosina
SUSE Labs

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Peter Stokes <hidden>
Date: 2008-03-04 18:55:55

On Tuesday 04 March 2008 12:47:15 Ville Syrjälä wrote:
On Sat, Feb 16, 2008 at 04:22:43PM +0000, Peter Stokes wrote:
quoted
The attached patch reconfigures the ati_remote2 driver to use
soft-autorepeat functionality and adds support for loadable key maps.
Why was this submitted (and even accepted) without cc:ing me?
I am very sorry, that was my fault, I should have cc'd you on the original 
mail.
quoted
I have reconfigure the driver to use the input system's built-in
autorepeat functionality as the device only appears to be able to produce
key repeat notifications at a fixed period. Switching to the software
autorepeat functionality provides more precise configuration of the
timings requested for repeat-delay and repeat-rate.
The soft-autorepeat support should be split into a separate patch. I don't
need such fast repeat but if it helps people I'm fine with it.
My reasoning behind modifying the ati_remote2 driver to use the  
soft-autorepeat implementation provided by the core input system was based 
upon the following:

* It states, in section 1.8 of "Documentation/input/input-programming.txt", 
the following:

  1.8 Key autorepeat
  ~~~~~~~~~~~~~~~~~~

  ... is simple. It is handled by the input.c module. Hardware autorepeat is
  not used, because it's not present in many devices and even where it is
  present, it is broken sometimes (at keyboards: Toshiba notebooks). To enable
  autorepeat for your device, just set EV_REP in dev->evbit. All will be
  handled by the input system.

* Using soft-autorepeat provides a more accurate behavior (the initial delay 
and the repeat rate behave as configured, as opposed to being rounded up to 
the nearest multiple of the hardware's, apparently fixed, repeat 
notifications (the hardware based repeat behavior also introduces timing 
aliasing where the actual interval between successive repeats is 
inconsistent).

* Using soft-autorepeat makes the code in ati_remote2 slightly simpler.

I am happy to produce a separate patch containing only the changes necessary 
to switch the ati_remote2 driver over to use the soft-autorepeat behavior, if 
that is indeed the consensus regarding the best approach to take.

As for ensuring that the mouse buttons on this device do not have auto-repeat 
behavior applied to them. I was very unsure of my proposed solution, as I 
attempted to express in my initial email on the subject. It does however 
strike me that if mouse buttons (and perhaps other button/key codes) should 
not be auto-repeated then these codes should be excluded from the auto-repeat 
implementation within the input core. Experimentation using my Microsoft 
Internet Keyboard appeared to indicate that regular keys where repeated but 
the extra buttons (things like launch email, launch web browser etc.) are not 
(my investigations appeared to indicate, contrary to section 1.8 of the 
documentation quoted above, that the repeat behavior was being performed by 
the hardware and not by the input system's soft-autorepeat implementation). 
This behavior appears to approximately coincide with the boundary described 
by the KEY_MIN_INTERESTING define but I had no idea whether that was merely 
coincidence.

I am happy to implement multiple input devices, one for the mouse, and one for 
the keyboard. If my understanding is correct, this would break backwards 
compatibility as the two devices would be exposed by the evdev driver as two 
separate event devices?

If anyone can suggest the best approach to this problem I would be happy to 
develop the necessary patches to implement the chosen solution.
 
quoted
As this device is exposed as a combined keyboard and mouse, this change
somewhat depends upon the suggested modification to the core
soft-autorepeat functionality as outlined in my previous post to the
linux-input mailing list (on 12th Feb 2008 entitled "Soft-autorepeat
functionality"), without that modification, the mouse buttons are
autorepeated :-(

The loadable keymap support exposes the ability to map 5 separate
keycodes to each key (depending on which "mode" the remote control is
currently in). Additionally, I have attempted to ensure that the
scancodes used to map keycodes to the keys lie outside of the range
normally covered by regular keyboards so as to avoid requests to remap
the keys on the remote from being intercepted by a normal keyboard.
I thought the idea of input devices was to reflect the hardware and the
keymaps should be handled in userspace. If that's not the case then I think
the keymap support code should not be inside the driver but instead inside
the input core. We don't want such invasive changes in every driver do
we?
If I may explain my reasoning behind proposing the changes associated with the 
loadable keymap support. I would welcome any feedback on my reasoning and 
approach.

My initial problem was that some of the keycodes mapped in the ati_remote2 
driver have values greater than 255 and as such I am unable to obtain the 
input from pressing those keys in X windows (perhaps I'm missing some 
required configuration of X windows somewhere?). Upon further investigation 
into this I noticed that the input core provides a mechanism for altering the 
keymap configuration but the ati_remote2 driver is not compatible with it.

Initially I simply modified the ati_remote2 to use the mechanism provided by 
the input core. Having done that, it occurred to me that the mode buttons of 
of the remote could be employed to effectively provide five sets of key 
mappings and I thought that this might be of some use to someone somewhere...

I appreciate that the implementation I have suggested is probably not in line 
with the original intended functionality of the loadable keymap support in 
the input system. But it does get round my issue with X windows....

It also occurred to me that perhaps the multiple-keyboards should be exposed 
as separate input devices, but again, if my understanding is correct, that 
would break backwards compatibility.

Any suggestions on better approaches would certainly be greatfully relieved.

Thank you for taking the time to read my rather long-winded email ;-)

Best regards

Peter Stokes


--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Ville Syrjälä <syrjala@sci.fi>
Date: 2008-03-04 19:53:22

On Tue, Mar 04, 2008 at 07:50:56PM +0100, Jiri Kosina wrote:
On Tue, 4 Mar 2008, Ville Syrjälä wrote:
quoted
I've attached the bzipped log.
Thanks. So between these two events:
<snip> 
you got autorepeated Key.LeftBtn?
I'm not sure actually. I made a new log and tried to actually
read it this time :)

When I press the button I see this:
drivers/hid/hid-core.c: report (size 6) (numbered)
drivers/hid/hid-core.c: report 17 (size 5) =  01 00 00 00 00
hid-debug: input Button.0001 = 1
hid-debug: input Button.0002 = 0
hid-debug: input Button.0003 = 0
hid-debug: input Button.0004 = 0
hid-debug: input Button.0005 = 0
hid-debug: input GenericDesktop.X = 0
hid-debug: input GenericDesktop.Y = 0
hid-debug: input GenericDesktop.Wheel = 0
hid-debug: input Consumer.HorizontalWheel = 0

When I release the button I get this:
drivers/hid/hid-core.c: report (size 6) (numbered)
drivers/hid/hid-core.c: report 17 (size 5) =  00 00 00 00 00
hid-debug: input Button.0001 = 0
hid-debug: input Button.0002 = 0
hid-debug: input Button.0003 = 0
hid-debug: input Button.0004 = 0
hid-debug: input Button.0005 = 0
hid-debug: input GenericDesktop.X = 0
hid-debug: input GenericDesktop.Y = 0
hid-debug: input GenericDesktop.Wheel = 0
hid-debug: input Consumer.HorizontalWheel = 0

In between I only see this report 5 + report 21 sequence constantly
repeated. But that sequence is constantly repeated even when I don't
touch the mouse at all. It makes inspecting the log somewhat annoying
since the amount of data grows fast. To add insult to injury this device
seems to take part in radio warfare against my normal mouse :(

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Jiri Kosina <hidden>
Date: 2008-03-04 20:28:57

On Tue, 4 Mar 2008, Ville Syrjälä wrote:
quoted
Thanks. So between these two events:
you got autorepeated Key.LeftBtn?
I'm not sure actually. I made a new log and tried to actually read it 
this time :)
Actually, this is the very same issue we discussed with respect to 
ati_remote2 changes ... this device has Keyboard usages as well as 
Mouse/Pointer. As we set the EV_REP (because of the Keyboard usage), this 
inputdevice-wide flag applies also to the mouse button events and they get 
repeated.

-- 
Jiri Kosina
SUSE Labs

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Ville Syrjälä <syrjala@sci.fi>
Date: 2008-03-04 20:32:13

On Tue, Mar 04, 2008 at 09:28:56PM +0100, Jiri Kosina wrote:
On Tue, 4 Mar 2008, Ville Syrjälä wrote:
quoted
quoted
Thanks. So between these two events:
you got autorepeated Key.LeftBtn?
I'm not sure actually. I made a new log and tried to actually read it 
this time :)
Actually, this is the very same issue we discussed with respect to 
ati_remote2 changes ... this device has Keyboard usages as well as 
Mouse/Pointer. As we set the EV_REP (because of the Keyboard usage), this 
inputdevice-wide flag applies also to the mouse button events and they get 
repeated.
Except this device does actually register two input devices since the
endpoints for the keyboard and mouse are separate, and here it even
makes sense since they are physically separate devices.

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Ville Syrjälä <syrjala@sci.fi>
Date: 2008-03-04 20:38:24

On Tue, Mar 04, 2008 at 06:55:49PM +0000, Peter Stokes wrote:
On Tuesday 04 March 2008 12:47:15 Ville Syrjälä wrote:
quoted
On Sat, Feb 16, 2008 at 04:22:43PM +0000, Peter Stokes wrote:
quoted
The attached patch reconfigures the ati_remote2 driver to use
soft-autorepeat functionality and adds support for loadable key maps.
Why was this submitted (and even accepted) without cc:ing me?
I am very sorry, that was my fault, I should have cc'd you on the original 
mail.
Apology accepted. No harm done :)
quoted
quoted
I have reconfigure the driver to use the input system's built-in
autorepeat functionality as the device only appears to be able to produce
key repeat notifications at a fixed period. Switching to the software
autorepeat functionality provides more precise configuration of the
timings requested for repeat-delay and repeat-rate.
The soft-autorepeat support should be split into a separate patch. I don't
need such fast repeat but if it helps people I'm fine with it.
My reasoning behind modifying the ati_remote2 driver to use the  
soft-autorepeat implementation provided by the core input system was based 
upon the following:

* It states, in section 1.8 of "Documentation/input/input-programming.txt", 
the following:

  1.8 Key autorepeat
  ~~~~~~~~~~~~~~~~~~

  ... is simple. It is handled by the input.c module. Hardware autorepeat is
  not used, because it's not present in many devices and even where it is
  present, it is broken sometimes (at keyboards: Toshiba notebooks). To enable
  autorepeat for your device, just set EV_REP in dev->evbit. All will be
  handled by the input system.

* Using soft-autorepeat provides a more accurate behavior (the initial delay 
and the repeat rate behave as configured, as opposed to being rounded up to 
the nearest multiple of the hardware's, apparently fixed, repeat 
notifications (the hardware based repeat behavior also introduces timing 
aliasing where the actual interval between successive repeats is 
inconsistent).

* Using soft-autorepeat makes the code in ati_remote2 slightly simpler.
Right. I think the only downside is additional timer interrupts to
handle the soft repeat. Probably the effect is too minimal to even
consider.

Dmitry did suggest using soft-repeat when I originally submitted the
driver but I had no need for a faster repeat rate so I didn't change the
driver to use it.
I am happy to produce a separate patch containing only the changes necessary 
to switch the ati_remote2 driver over to use the soft-autorepeat behavior, if 
that is indeed the consensus regarding the best approach to take.
Yes, I'd like one patch per feature.
As for ensuring that the mouse buttons on this device do not have auto-repeat 
behavior applied to them. I was very unsure of my proposed solution, as I 
attempted to express in my initial email on the subject. It does however 
strike me that if mouse buttons (and perhaps other button/key codes) should 
not be auto-repeated then these codes should be excluded from the auto-repeat 
implementation within the input core. Experimentation using my Microsoft 
Internet Keyboard appeared to indicate that regular keys where repeated but 
the extra buttons (things like launch email, launch web browser etc.) are not 
(my investigations appeared to indicate, contrary to section 1.8 of the 
documentation quoted above, that the repeat behavior was being performed by 
the hardware and not by the input system's soft-autorepeat implementation). 
This behavior appears to approximately coincide with the boundary described 
by the KEY_MIN_INTERESTING define but I had no idea whether that was merely 
coincidence.

I am happy to implement multiple input devices, one for the mouse, and one for 
the keyboard. If my understanding is correct, this would break backwards 
compatibility as the two devices would be exposed by the evdev driver as two 
separate event devices?

If anyone can suggest the best approach to this problem I would be happy to 
develop the necessary patches to implement the chosen solution.
Ah, the backwards compatibility angle. It would be rude of us to break
the behaviour like that. It probably wouldn't affect my typical use case
(MPlayer + DirectFB) since I typically only use the keyboard part of the
remote. But if there are people using both "components" of the remote they
would have to change their configuration or in the worst case their code to
handle such a change. Not nice at all.
quoted
quoted
As this device is exposed as a combined keyboard and mouse, this change
somewhat depends upon the suggested modification to the core
soft-autorepeat functionality as outlined in my previous post to the
linux-input mailing list (on 12th Feb 2008 entitled "Soft-autorepeat
functionality"), without that modification, the mouse buttons are
autorepeated :-(

The loadable keymap support exposes the ability to map 5 separate
keycodes to each key (depending on which "mode" the remote control is
currently in). Additionally, I have attempted to ensure that the
scancodes used to map keycodes to the keys lie outside of the range
normally covered by regular keyboards so as to avoid requests to remap
the keys on the remote from being intercepted by a normal keyboard.
I thought the idea of input devices was to reflect the hardware and the
keymaps should be handled in userspace. If that's not the case then I think
the keymap support code should not be inside the driver but instead inside
the input core. We don't want such invasive changes in every driver do
we?
If I may explain my reasoning behind proposing the changes associated with the 
loadable keymap support. I would welcome any feedback on my reasoning and 
approach.

My initial problem was that some of the keycodes mapped in the ati_remote2 
driver have values greater than 255 and as such I am unable to obtain the 
input from pressing those keys in X windows (perhaps I'm missing some 
required configuration of X windows somewhere?). Upon further investigation 
into this I noticed that the input core provides a mechanism for altering the 
keymap configuration but the ati_remote2 driver is not compatible with it.
Ah, the dreaded X angle :) A bit of googling tells me that the X guys
don't have a real fix coming any time soon. I suppose that is one reason
for having some kind of keymap support in the input core. I personally
don't care for it but there are apprently too few people who can digest
the Xorg code so I suppose it has a compelling reason for existence.
Initially I simply modified the ati_remote2 to use the mechanism provided by 
the input core. Having done that, it occurred to me that the mode buttons of 
of the remote could be employed to effectively provide five sets of key 
mappings and I thought that this might be of some use to someone somewhere...

I appreciate that the implementation I have suggested is probably not in line 
with the original intended functionality of the loadable keymap support in 
the input system. But it does get round my issue with X windows....

It also occurred to me that perhaps the multiple-keyboards should be exposed 
as separate input devices, but again, if my understanding is correct, that 
would break backwards compatibility.

Any suggestions on better approaches would certainly be greatfully relieved.
I think you could implement the multiple keymaps thing rather trivially
in user space by having a small daemon listening on the event device and
loading a new keymap when a mode key is pressed. That would limit the
changes to the driver, and it would not require any kernel changes when
if you would need to adapt it to a device that uses a different driver.

I think the only problem is the grab thingy. I'm not sure if the Xorg 
evdev driver grabs the device, but if it does then the daemon wouldn't
be able to see the events. DirectFB's input driver does grab the device 
to prevent events leaking to the console (ctrl-c combination was
rather unpleasant without the grab). One solution would be a more
light weight grab that would only prevent the console from receiving the
events but would let other applications to see them. I remeber seeing
some discussion around device grab in the past. I wonder if anything
useful came of it...

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Jiri Kosina <hidden>
Date: 2008-03-04 20:42:23

On Tue, 4 Mar 2008, Ville Syrjälä wrote:
quoted
Actually, this is the very same issue we discussed with respect to 
ati_remote2 changes ... this device has Keyboard usages as well as 
Mouse/Pointer. As we set the EV_REP (because of the Keyboard usage), 
this inputdevice-wide flag applies also to the mouse button events and 
they get repeated.
Except this device does actually register two input devices since the
endpoints for the keyboard and mouse are separate, and here it even
makes sense since they are physically separate devices.
Yes, but unfortunately both interfaces contain Keyboard usage in their 
report descriptor -- please see the debug output you sent me. The first 
interface's descriptor states to send Keyboard usages in Field(1) of INPUT 
report, the second one presents it in Field(1) of INPUT[1] report.

I guess that one of the report descriptors contains redundant information, 
not both interfaces are actually sending Keyboard/Consumer/etc events, 
right?

The possibility for this particular device might be fixing the report 
descriptor on the fly, before it enters the parser. We do it for certain 
broken HID devices already.

-- 
Jiri Kosina
SUSE Labs

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Ville Syrjälä <syrjala@sci.fi>
Date: 2008-03-04 21:21:07

On Tue, Mar 04, 2008 at 09:42:22PM +0100, Jiri Kosina wrote:
On Tue, 4 Mar 2008, Ville Syrjälä wrote:
quoted
quoted
Actually, this is the very same issue we discussed with respect to 
ati_remote2 changes ... this device has Keyboard usages as well as 
Mouse/Pointer. As we set the EV_REP (because of the Keyboard usage), 
this inputdevice-wide flag applies also to the mouse button events and 
they get repeated.
Except this device does actually register two input devices since the
endpoints for the keyboard and mouse are separate, and here it even
makes sense since they are physically separate devices.
Yes, but unfortunately both interfaces contain Keyboard usage in their 
report descriptor -- please see the debug output you sent me. The first 
interface's descriptor states to send Keyboard usages in Field(1) of INPUT 
report, the second one presents it in Field(1) of INPUT[1] report.

I guess that one of the report descriptors contains redundant information, 
not both interfaces are actually sending Keyboard/Consumer/etc events, 
right?
I suppose not. HID is more or less gibberish to me but at least I haven't
seen any extra keyboard events from the mouse or anything like that. The
mouse has just two buttons and a vertical wheel. The keyboard has the normal
keys, volume and playback control keys and some 10 extra keys like sleep,
mail, web etc. It also has an f-lock key which I suppose has something to
do with the fact that they've re-labeled the function keys with some
web/email/whatever texts and the F<number> is printed on the side
of the key.

I've used the device so little that I honestly didn't even notice that
the mouse claims to support pretty much every kind of event there is.
Maybe they were just lazy when making this device and didn't want to think
about the actual features of the device and instead just added every
possible thing to the descriptors.

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Peter Stokes <hidden>
Date: 2008-03-04 21:34:36

On Tuesday 04 March 2008 20:38:22 Ville Syrjälä wrote:
On Tue, Mar 04, 2008 at 06:55:49PM +0000, Peter Stokes wrote:
quoted
On Tuesday 04 March 2008 12:47:15 Ville Syrjälä wrote:
quoted
On Sat, Feb 16, 2008 at 04:22:43PM +0000, Peter Stokes wrote:
quoted
The attached patch reconfigures the ati_remote2 driver to use
soft-autorepeat functionality and adds support for loadable key maps.
Why was this submitted (and even accepted) without cc:ing me?
I am very sorry, that was my fault, I should have cc'd you on the
original mail.
Apology accepted. No harm done :)
Thank you :-)
quoted
quoted
quoted
I have reconfigure the driver to use the input system's built-in
autorepeat functionality as the device only appears to be able to
produce key repeat notifications at a fixed period. Switching to the
software autorepeat functionality provides more precise configuration
of the timings requested for repeat-delay and repeat-rate.
The soft-autorepeat support should be split into a separate patch. I
don't need such fast repeat but if it helps people I'm fine with it.
My reasoning behind modifying the ati_remote2 driver to use the
soft-autorepeat implementation provided by the core input system was
based upon the following:

* It states, in section 1.8 of
"Documentation/input/input-programming.txt", the following:

  1.8 Key autorepeat
  ~~~~~~~~~~~~~~~~~~

  ... is simple. It is handled by the input.c module. Hardware autorepeat
is not used, because it's not present in many devices and even where it
is present, it is broken sometimes (at keyboards: Toshiba notebooks). To
enable autorepeat for your device, just set EV_REP in dev->evbit. All
will be handled by the input system.

* Using soft-autorepeat provides a more accurate behavior (the initial
delay and the repeat rate behave as configured, as opposed to being
rounded up to the nearest multiple of the hardware's, apparently fixed,
repeat notifications (the hardware based repeat behavior also introduces
timing aliasing where the actual interval between successive repeats is
inconsistent).

* Using soft-autorepeat makes the code in ati_remote2 slightly simpler.
Right. I think the only downside is additional timer interrupts to
handle the soft repeat. Probably the effect is too minimal to even
consider.

Dmitry did suggest using soft-repeat when I originally submitted the
driver but I had no need for a faster repeat rate so I didn't change the
driver to use it.
quoted
I am happy to produce a separate patch containing only the changes
necessary to switch the ati_remote2 driver over to use the
soft-autorepeat behavior, if that is indeed the consensus regarding the
best approach to take.
Yes, I'd like one patch per feature.
I'll do that (do need to sort out exactly how to implement it first though)
quoted
As for ensuring that the mouse buttons on this device do not have
auto-repeat behavior applied to them. I was very unsure of my proposed
solution, as I attempted to express in my initial email on the subject.
It does however strike me that if mouse buttons (and perhaps other
button/key codes) should not be auto-repeated then these codes should be
excluded from the auto-repeat implementation within the input core.
Experimentation using my Microsoft Internet Keyboard appeared to indicate
that regular keys where repeated but the extra buttons (things like
launch email, launch web browser etc.) are not (my investigations
appeared to indicate, contrary to section 1.8 of the documentation quoted
above, that the repeat behavior was being performed by the hardware and
not by the input system's soft-autorepeat implementation). This behavior
appears to approximately coincide with the boundary described by the
KEY_MIN_INTERESTING define but I had no idea whether that was merely
coincidence.




I am happy to implement multiple input devices, one for the mouse, and
one for the keyboard. If my understanding is correct, this would break
backwards compatibility as the two devices would be exposed by the evdev
driver as two separate event devices?

If anyone can suggest the best approach to this problem I would be happy
to develop the necessary patches to implement the chosen solution.
Ah, the backwards compatibility angle. It would be rude of us to break
the behaviour like that. It probably wouldn't affect my typical use case
(MPlayer + DirectFB) since I typically only use the keyboard part of the
remote. But if there are people using both "components" of the remote they
would have to change their configuration or in the worst case their code to
handle such a change. Not nice at all.
The backwards compatibility wouldn't be a problem for me either (I'm using X 
windows and MythTV). I felt that the original choice of keymappings 
represents the closest match between the images physically printed on the 
keys and the descriptions contained in the standard keycode defines but 
unfortunately they result in some fairly crucial keys (like 'ok' for example) 
being undetectable in X windows :-( 

I suspect that that very few people are currently using this driver for this 
very reason, and upon that entirely unsubstantiated assumption I'd suggest 
that if it is deemed that the best approach is to expose the mouse and 
keyboard functionality as two separate devices then that would probably be 
acceptable?

My personal feeling is that, if mouse buttons (and other keycodes) should not 
be repeated, then they should be excluded from the soft-autorepeat 
functionality offered by the input core.
quoted
quoted
quoted
As this device is exposed as a combined keyboard and mouse, this
change somewhat depends upon the suggested modification to the core
soft-autorepeat functionality as outlined in my previous post to the
linux-input mailing list (on 12th Feb 2008 entitled "Soft-autorepeat
functionality"), without that modification, the mouse buttons are
autorepeated :-(

The loadable keymap support exposes the ability to map 5 separate
keycodes to each key (depending on which "mode" the remote control is
currently in). Additionally, I have attempted to ensure that the
scancodes used to map keycodes to the keys lie outside of the range
normally covered by regular keyboards so as to avoid requests to
remap the keys on the remote from being intercepted by a normal
keyboard.
I thought the idea of input devices was to reflect the hardware and the
keymaps should be handled in userspace. If that's not the case then I
think the keymap support code should not be inside the driver but
instead inside the input core. We don't want such invasive changes in
every driver do we?
If I may explain my reasoning behind proposing the changes associated
with the loadable keymap support. I would welcome any feedback on my
reasoning and approach.

My initial problem was that some of the keycodes mapped in the
ati_remote2 driver have values greater than 255 and as such I am unable
to obtain the input from pressing those keys in X windows (perhaps I'm
missing some required configuration of X windows somewhere?). Upon
further investigation into this I noticed that the input core provides a
mechanism for altering the keymap configuration but the ati_remote2
driver is not compatible with it.
Ah, the dreaded X angle :) A bit of googling tells me that the X guys
don't have a real fix coming any time soon. I suppose that is one reason
for having some kind of keymap support in the input core. I personally
don't care for it but there are apprently too few people who can digest
the Xorg code so I suppose it has a compelling reason for existence.
quoted
Initially I simply modified the ati_remote2 to use the mechanism provided
by the input core. Having done that, it occurred to me that the mode
buttons of of the remote could be employed to effectively provide five
sets of key mappings and I thought that this might be of some use to
someone somewhere...

I appreciate that the implementation I have suggested is probably not in
line with the original intended functionality of the loadable keymap
support in the input system. But it does get round my issue with X
windows....

It also occurred to me that perhaps the multiple-keyboards should be
exposed as separate input devices, but again, if my understanding is
correct, that would break backwards compatibility.

Any suggestions on better approaches would certainly be greatfully
relieved.
I think you could implement the multiple keymaps thing rather trivially
in user space by having a small daemon listening on the event device and
loading a new keymap when a mode key is pressed. That would limit the
changes to the driver, and it would not require any kernel changes when
if you would need to adapt it to a device that uses a different driver.

I think the only problem is the grab thingy. I'm not sure if the Xorg
evdev driver grabs the device, but if it does then the daemon wouldn't
be able to see the events. DirectFB's input driver does grab the device
to prevent events leaking to the console (ctrl-c combination was
rather unpleasant without the grab). One solution would be a more
light weight grab that would only prevent the console from receiving the
events but would let other applications to see them. I remeber seeing
some discussion around device grab in the past. I wonder if anything
useful came of it...
When I initially implemented the loadable keymap support using the input core 
built in handling I hit the problem that I wanted to override the keys on the 
remote control (the reason for looking into all of this) but some of the 
scancode were taken by the standard PS2 keyboard driver. I reasoned that most 
people wouldn't want to break their regular keyboard mappings so I then 
implemented my own get/setkeycode functions in order to place the remote's 
scancodes outside of the normal range produced by regular keyboards. Once I'd 
had to implement my own versions of those functions it seemed trivial to 
provide the 'layered' keyboard implementation.

I must confess I don't have an immediate requirement for this functionality it 
just seemed an easy and potentially useful thing to provide...

My understanding of the X windows situation is that the X server protocol only 
allows a single byte for keycodes,and as the server protocol is an network 
standard it's not a case of changing some code it's a case of changing the 
standard (something that isn't going to happen particularly quickly!). Hence 
this seemed like a reasonable, if not entirely elegant, way around it...


--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Jiri Kosina <hidden>
Date: 2008-03-04 22:02:41

On Tue, 4 Mar 2008, Ville Syrjälä wrote:
I've used the device so little that I honestly didn't even notice that 
the mouse claims to support pretty much every kind of event there is. 
Maybe they were just lazy when making this device and didn't want to 
think about the actual features of the device and instead just added 
every possible thing to the descriptors.
Exactly. We could either fix the report descriptor upon initialization, or 
put some quirk into event handler, that will make sure that the mouse 
buttons won't get repeated for this particular device.

-- 
Jiri Kosina
SUSE Labs

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Ville Syrjälä <syrjala@sci.fi>
Date: 2008-03-04 22:17:51

On Tue, Mar 04, 2008 at 09:34:29PM +0000, Peter Stokes wrote:
On Tuesday 04 March 2008 20:38:22 Ville Syrjälä wrote:
quoted
On Tue, Mar 04, 2008 at 06:55:49PM +0000, Peter Stokes wrote:
quoted
I am happy to produce a separate patch containing only the changes
necessary to switch the ati_remote2 driver over to use the
soft-autorepeat behavior, if that is indeed the consensus regarding the
best approach to take.
Yes, I'd like one patch per feature.
I'll do that (do need to sort out exactly how to implement it first though)
Right.
quoted
quoted
As for ensuring that the mouse buttons on this device do not have
auto-repeat behavior applied to them. I was very unsure of my proposed
solution, as I attempted to express in my initial email on the subject.
It does however strike me that if mouse buttons (and perhaps other
button/key codes) should not be auto-repeated then these codes should be
excluded from the auto-repeat implementation within the input core.
Experimentation using my Microsoft Internet Keyboard appeared to indicate
that regular keys where repeated but the extra buttons (things like
launch email, launch web browser etc.) are not (my investigations
appeared to indicate, contrary to section 1.8 of the documentation quoted
above, that the repeat behavior was being performed by the hardware and
not by the input system's soft-autorepeat implementation). This behavior
appears to approximately coincide with the boundary described by the
KEY_MIN_INTERESTING define but I had no idea whether that was merely
coincidence.




I am happy to implement multiple input devices, one for the mouse, and
one for the keyboard. If my understanding is correct, this would break
backwards compatibility as the two devices would be exposed by the evdev
driver as two separate event devices?

If anyone can suggest the best approach to this problem I would be happy
to develop the necessary patches to implement the chosen solution.
Ah, the backwards compatibility angle. It would be rude of us to break
the behaviour like that. It probably wouldn't affect my typical use case
(MPlayer + DirectFB) since I typically only use the keyboard part of the
remote. But if there are people using both "components" of the remote they
would have to change their configuration or in the worst case their code to
handle such a change. Not nice at all.
The backwards compatibility wouldn't be a problem for me either (I'm using X 
windows and MythTV). I felt that the original choice of keymappings 
represents the closest match between the images physically printed on the 
keys and the descriptions contained in the standard keycode defines but 
unfortunately they result in some fairly crucial keys (like 'ok' for example) 
being undetectable in X windows :-( 

I suspect that that very few people are currently using this driver for this 
very reason, and upon that entirely unsubstantiated assumption I'd suggest 
that if it is deemed that the best approach is to expose the mouse and 
keyboard functionality as two separate devices then that would probably be 
acceptable?

My personal feeling is that, if mouse buttons (and other keycodes) should not 
be repeated, then they should be excluded from the soft-autorepeat 
functionality offered by the input core.
I think that repeating buttons are a good thing in some cases (autofire 
in games for example). Then again such games could implement autofire
themselves.

However I don't see why the repeat vs. no repeat case should depend on
the device reporting or not reporting keyboard keys. I don't see any real
connection with a device having some keyboard keys and sending repeat
events for buttons.

Let's say you have a HID keyboard which does in fact have an integrated
trackball/whatever (at least keyboard with scroll wheels exists so adding
a complete trackball doesn't seem that far fetched) but instead of having
separate end points for each "device" it would just have one endpoint.
That device would experience the same problem that my HID mouse has.
quoted
I think you could implement the multiple keymaps thing rather trivially
in user space by having a small daemon listening on the event device and
loading a new keymap when a mode key is pressed. That would limit the
changes to the driver, and it would not require any kernel changes when
if you would need to adapt it to a device that uses a different driver.

I think the only problem is the grab thingy. I'm not sure if the Xorg
evdev driver grabs the device, but if it does then the daemon wouldn't
be able to see the events. DirectFB's input driver does grab the device
to prevent events leaking to the console (ctrl-c combination was
rather unpleasant without the grab). One solution would be a more
light weight grab that would only prevent the console from receiving the
events but would let other applications to see them. I remeber seeing
some discussion around device grab in the past. I wonder if anything
useful came of it...
When I initially implemented the loadable keymap support using the input core 
built in handling I hit the problem that I wanted to override the keys on the 
remote control (the reason for looking into all of this) but some of the 
scancode were taken by the standard PS2 keyboard driver. I reasoned that most 
people wouldn't want to break their regular keyboard mappings so I then 
implemented my own get/setkeycode functions in order to place the remote's 
scancodes outside of the normal range produced by regular keyboards. Once I'd 
had to implement my own versions of those functions it seemed trivial to 
provide the 'layered' keyboard implementation.

I must confess I don't have an immediate requirement for this functionality it 
just seemed an easy and potentially useful thing to provide...

My understanding of the X windows situation is that the X server protocol only 
allows a single byte for keycodes,and as the server protocol is an network 
standard it's not a case of changing some code it's a case of changing the 
standard (something that isn't going to happen particularly quickly!). Hence 
this seemed like a reasonable, if not entirely elegant, way around it...
http://bugs.freedesktop.org/show_bug.cgi?id=11227
has some ideas about compressing the keycodes to the 8-255 range for
each device by using device specific keymaps.

However, since that seems unlikely to happen, and the input core already
has support for keymaps I'm fine with adding the set/getkeycode stuff.
What I'd like to drop is the support for five different keymaps since
AFAICS that could be handled in a more generic way in user space.

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Jiri Kosina <hidden>
Date: 2008-03-04 22:25:23

On Wed, 5 Mar 2008, Ville Syrjälä wrote:
However I don't see why the repeat vs. no repeat case should depend on 
the device reporting or not reporting keyboard keys. I don't see any 
real connection with a device having some keyboard keys and sending 
repeat events for buttons.
The problem is, that currently EV_REP is per-device flag. Once we set it, 
it is valid for all EV_KEY events (which includes keyboard events, but 
also mouse buttons).

I think it might be good to redesign this a little bit, but I'd like to 
hear Dmitry's opinion here, let's see when he will appear.

Thanks,

-- 
Jiri Kosina
SUSE Labs

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Jiri Kosina <hidden>
Date: 2008-03-25 08:23:20

On Tue, 4 Mar 2008, Jiri Kosina wrote:
quoted
However I don't see why the repeat vs. no repeat case should depend on 
the device reporting or not reporting keyboard keys. I don't see any 
real connection with a device having some keyboard keys and sending 
repeat events for buttons.
The problem is, that currently EV_REP is per-device flag. Once we set 
it, it is valid for all EV_KEY events (which includes keyboard events, 
but also mouse buttons).
I think it might be good to redesign this a little bit, but I'd like to 
hear Dmitry's opinion here, let's see when he will appear.
Dmitry,

do you have any opinion/idea what might be the best soltuion please?

Thanks,

-- 
Jiri Kosina
SUSE Labs

Re: [PATCH] ati_remote2 autorepeat and loadable keymap support

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2008-04-07 20:39:54

On Tue, Mar 25, 2008 at 09:23:02AM +0100, Jiri Kosina wrote:
On Tue, 4 Mar 2008, Jiri Kosina wrote:
quoted
quoted
However I don't see why the repeat vs. no repeat case should depend on 
the device reporting or not reporting keyboard keys. I don't see any 
real connection with a device having some keyboard keys and sending 
repeat events for buttons.
The problem is, that currently EV_REP is per-device flag. Once we set 
it, it is valid for all EV_KEY events (which includes keyboard events, 
but also mouse buttons).
I think it might be good to redesign this a little bit, but I'd like to 
hear Dmitry's opinion here, let's see when he will appear.
Dmitry,

do you have any opinion/idea what might be the best soltuion please?
I think that for now it is driver's responsibility to implement "fancy"
autorepeat, if needed. I think good implementation should respect repeat
rate settings requested from userspace though...

If there are lots of drivers implementing autorepeat themselves and we
start seeing common patterns we could start moving it to the core,
probably by implementing some helper functions. Does this make sense?

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help