linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* HID: is scancode correctly reported after key status change in hidinput_hid_event()?
@ 2010-01-09 15:05 Roel Kluin
  2010-01-09 15:15 ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Roel Kluin @ 2010-01-09 15:05 UTC (permalink / raw)
  To: Jiri Kosina, linux-input, LKML

vi drivers/hid/hid-input.c +634 and not in hidinput_hid_event()

 	/* report the usage code as scancode if the key status has changed */
	if (usage->type == EV_KEY && !!test_bit(usage->code, input->key) != value)
 		input_event(input, EV_MSC, MSC_SCAN, usage->hid);

Only if value is 1 or 0 the input_event() can occur, but value doesn't
seem to be intended to be used as a boolean. are we really doing the
correct test here?

Roel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: HID: is scancode correctly reported after key status change in hidinput_hid_event()?
  2010-01-09 15:05 HID: is scancode correctly reported after key status change in hidinput_hid_event()? Roel Kluin
@ 2010-01-09 15:15 ` Jiri Kosina
  2010-01-09 18:51   ` roel kluin
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Kosina @ 2010-01-09 15:15 UTC (permalink / raw)
  To: Roel Kluin; +Cc: linux-input, LKML

On Sat, 9 Jan 2010, Roel Kluin wrote:

> vi drivers/hid/hid-input.c +634 and not in hidinput_hid_event()
> 
>  	/* report the usage code as scancode if the key status has changed */
> 	if (usage->type == EV_KEY && !!test_bit(usage->code, input->key) != value)
>  		input_event(input, EV_MSC, MSC_SCAN, usage->hid);
> 
> Only if value is 1 or 0 the input_event() can occur, but value doesn't
> seem to be intended to be used as a boolean. are we really doing the
> correct test here?

Hi Roel,

well, value 2 means 'repeated' key, and there is no other possibility for 
EV_KEY value than 0,1,2.

For EV_KEY events generated by HID devices, the autorepeat is done by 
input core (as the device sends the report only when status is changed), 
so there is no easy way how to inject EV_MSC into the 'autorepeat reports' 
anyway.

Are you hitting some bug because of this, or have you found this out 
solely by code reading?

Thanks,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: HID: is scancode correctly reported after key status change in hidinput_hid_event()?
  2010-01-09 15:15 ` Jiri Kosina
@ 2010-01-09 18:51   ` roel kluin
  0 siblings, 0 replies; 3+ messages in thread
From: roel kluin @ 2010-01-09 18:51 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, LKML

On Sat, Jan 9, 2010 at 4:15 PM, Jiri Kosina <jkosina@suse.cz> wrote:
> On Sat, 9 Jan 2010, Roel Kluin wrote:
>
>> vi drivers/hid/hid-input.c +634 and not in hidinput_hid_event()
>>
>>       /* report the usage code as scancode if the key status has changed */
>>       if (usage->type == EV_KEY && !!test_bit(usage->code, input->key) != value)
>>               input_event(input, EV_MSC, MSC_SCAN, usage->hid);
>>
>> Only if value is 1 or 0 the input_event() can occur, but value doesn't
>> seem to be intended to be used as a boolean. are we really doing the
>> correct test here?
>
> Hi Roel,
>
> well, value 2 means 'repeated' key, and there is no other possibility for
> EV_KEY value than 0,1,2.
>
> For EV_KEY events generated by HID devices, the autorepeat is done by
> input core (as the device sends the report only when status is changed),
> so there is no easy way how to inject EV_MSC into the 'autorepeat reports'
> anyway.
>
> Are you hitting some bug because of this, or have you found this out
> solely by code reading?

only code reading.

Thanks
--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-09 18:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-09 15:05 HID: is scancode correctly reported after key status change in hidinput_hid_event()? Roel Kluin
2010-01-09 15:15 ` Jiri Kosina
2010-01-09 18:51   ` roel kluin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).