Skip to contentSkip to conversation

Warning: evdev changes - no auto-grabs anymore

DISCUSSION Ville Syrjälä 5 participants 7 messages Aug 15, 2008 6 messages not in the archive HID

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20080814044337.GA11632@emu

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 20080815002458.GA16836@emu

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 18 lines · Daniel Stone
Quoted 17 lines · Ville Syrjälä
Quoted 15 lines · Peter Hutterer
Quoted 10 lines · Adam Jackson

This is, in fact, one of the main reasons I put SIOCGRAB there in the first place; you need to keep the keyboard's event stream out of the tty layer entirely, not just out of reach of the kbd driver. At the time the argument was also that you wanted to keep them out of reach of normal users so you couldn't snoop passwords, but now that there's a ConsoleKit I think that's less true.

Mac mouse emulation we could probably just blacklist away from the evdev driver. rfkill is... harder? Does it get its own event device or not? I'd think it would have to get one kill device per wireless device.

The issue is not grabbing the mouse emulation device, it's grabbing the keyboard that generates those keys events that should result in a button click on a different device. So we'd need something in the kernel I guess.

Quoted 7 lines
Quoted 3 lines

I was pondering about the same issue wrt. DirectFB. I wonder if KDSETMODE/KD_GRAPHICS could be extended to take care of this or would it break some existing applications.

Yeah, I was thinking about that, but that would mean we have issues under older kernels. I think the best was what I was proposing, which would be EVIOCSERIOUSLYDONTSENDANYCONSOLEINPUTWEWILLDEALWITHIT().

Yeah that would be better since support for it could be detected runtime so the driver could do the right thing when running with a recent kernel, and it could just fall back to the normal grab with old kernels.

Let's cc the linux-input list...

Signature · 3 lines
Ville Syrjälä
[email protected]
http://www.sci.fi/~syrjala/
#7 lore raw
Quoted 23 lines · Ville Syrj?l?
Quoted 22 lines · Daniel Stone
Quoted 20 lines · Ville Syrj?l?
Quoted 8 lines · Peter Hutterer
Quoted 7 lines · Adam Jackson

This is, in fact, one of the main reasons I put SIOCGRAB there in the first place; you need to keep the keyboard's event stream out of the tty layer entirely, not just out of reach of the kbd driver. At the time the argument was also that you wanted to keep them out of reach of normal users so you couldn't snoop passwords, but now that there's a ConsoleKit I think that's less true.

Quoted 7 lines
Quoted 3 lines

Mac mouse emulation we could probably just blacklist away from the evdev driver. rfkill is... harder? Does it get its own event device or not? I'd think it would have to get one kill device per wireless device.

The issue is not grabbing the mouse emulation device, it's grabbing the keyboard that generates those keys events that should result in a button click on a different device. So we'd need something in the kernel I guess.

I was pondering about the same issue wrt. DirectFB. I wonder if KDSETMODE/KD_GRAPHICS could be extended to take care of this or would it break some existing applications.

Quoted 8 lines
Quoted 3 lines

Yeah, I was thinking about that, but that would mean we have issues under older kernels. I think the best was what I was proposing, which would be EVIOCSERIOUSLYDONTSENDANYCONSOLEINPUTWEWILLDEALWITHIT().

Yeah that would be better since support for it could be detected runtime so the driver could do the right thing when running with a recent kernel, and it could just fall back to the normal grab with old kernels.

If evdev support in X is maturing why does it even need using tty and mousedev multiplexors? If you just use evdev for all of your devices you would not have the problem of duplicate events coming from 2 interfaces.

Signature · 1 line
Dmitry
#8 lore raw
Quoted 11 lines · Dmitry Torokhov
Quoted 10 lines · Ville Syrj?l?
Quoted 8 lines · Daniel Stone
Quoted 3 lines · Ville Syrj?l?

I was pondering about the same issue wrt. DirectFB. I wonder if KDSETMODE/KD_GRAPHICS could be extended to take care of this or would it break some existing applications.

Yeah, I was thinking about that, but that would mean we have issues under older kernels. I think the best was what I was proposing, which would be EVIOCSERIOUSLYDONTSENDANYCONSOLEINPUTWEWILLDEALWITHIT().

Quoted 8 lines
Quoted 3 lines

Yeah that would be better since support for it could be detected runtime so the driver could do the right thing when running with a recent kernel, and it could just fall back to the normal grab with old kernels.

If evdev support in X is maturing why does it even need using tty and mousedev multiplexors? If you just use evdev for all of your devices you would not have the problem of duplicate events coming from 2 interfaces.

We don't, and killing them is fine. Even so, try doing that, and realise that the TTY layer has helpfully spewed out every single thing you've typed, oh, and Ctrl-C kills the X server.

So it would seem that an ioctl to say 'I'm dealing with this, don't let the TTY layer and mousedev get at it' would be helpful, but one that stops short of a full grab.

Cheers,
Daniel

_______________________________________________
xorg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xorg

#9 lore raw
Quoted 3 lines

So it would seem that an ioctl to say 'I'm dealing with this, don't let the TTY layer and mousedev get at it' would be helpful, but one that stops short of a full grab.

There is a requirement for secure attention key processing in some environments. Being able to divert the SAK key wouldn't be acceptable so some care is needed.

Alan

#10 lore raw
In reply to Daniel Stone
Quoted 16 lines · Daniel Stone
Quoted 15 lines · Dmitry Torokhov
Quoted 13 lines · Ville Syrj?l?
Quoted 8 lines · Daniel Stone
Quoted 3 lines · Ville Syrj?l?

I was pondering about the same issue wrt. DirectFB. I wonder if KDSETMODE/KD_GRAPHICS could be extended to take care of this or would it break some existing applications.

Yeah, I was thinking about that, but that would mean we have issues under older kernels. I think the best was what I was proposing, which would be EVIOCSERIOUSLYDONTSENDANYCONSOLEINPUTWEWILLDEALWITHIT().

Yeah that would be better since support for it could be detected runtime so the driver could do the right thing when running with a recent kernel, and it could just fall back to the normal grab with old kernels.

Quoted 9 lines
Quoted 4 lines

If evdev support in X is maturing why does it even need using tty and mousedev multiplexors? If you just use evdev for all of your devices you would not have the problem of duplicate events coming from 2 interfaces.

We don't, and killing them is fine. Even so, try doing that, and realise that the TTY layer has helpfully spewed out every single thing you've typed, oh, and Ctrl-C kills the X server.

[taking xorg list off as it does not take my posts...]

Would not putting VC in raw mode and just ignoring the data coming out of it take care of this problem?

Signature · 1 line
Dmitry
#11 lore raw
In reply to Dmitry Torokhov
Quoted 33 lines · Dmitry Torokhov
Quoted 23 lines · Ville Syrj?l?
Quoted 22 lines · Daniel Stone
Quoted 20 lines · Ville Syrj?l?
Quoted 8 lines · Peter Hutterer
Quoted 7 lines · Adam Jackson

This is, in fact, one of the main reasons I put SIOCGRAB there in the first place; you need to keep the keyboard's event stream out of the tty layer entirely, not just out of reach of the kbd driver. At the time the argument was also that you wanted to keep them out of reach of normal users so you couldn't snoop passwords, but now that there's a ConsoleKit I think that's less true.

Quoted 7 lines
Quoted 3 lines

Mac mouse emulation we could probably just blacklist away from the evdev driver. rfkill is... harder? Does it get its own event device or not? I'd think it would have to get one kill device per wireless device.

The issue is not grabbing the mouse emulation device, it's grabbing the keyboard that generates those keys events that should result in a button click on a different device. So we'd need something in the kernel I guess.

I was pondering about the same issue wrt. DirectFB. I wonder if KDSETMODE/KD_GRAPHICS could be extended to take care of this or would it break some existing applications.

Quoted 8 lines
Quoted 3 lines

Yeah, I was thinking about that, but that would mean we have issues under older kernels. I think the best was what I was proposing, which would be EVIOCSERIOUSLYDONTSENDANYCONSOLEINPUTWEWILLDEALWITHIT().

Yeah that would be better since support for it could be detected runtime so the driver could do the right thing when running with a recent kernel, and it could just fall back to the normal grab with old kernels.

Quoted 4 lines

If evdev support in X is maturing why does it even need using tty and mousedev multiplexors? If you just use evdev for all of your devices you would not have the problem of duplicate events coming from 2 interfaces.

That's not the problem. The problem is that when using evdev without grabs any keyboardish input also goes to the console. For stuff like ctrl-c it's particularly nasty since it will result in the X server exiting.

This also affect DirectFB and it was the original reason why I added EVIOCGRAB code to DirectFB's linux-input driver. Grabbing didn't cause problems back then but now that the input subsystem is used by rfkill/acpi/etc. functionalitys is lost when the devices are grabbed.

Signature · 7 lines
Ville Syrjälä
[email protected]
http://www.sci.fi/~syrjala/
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#12 lore raw
Quoted 4 lines · Ville Syrjälä, le Fri 15 Aug 2008 17:39:21 +0300, a écrit :

This also affect DirectFB and it was the original reason why I added EVIOCGRAB code to DirectFB's linux-input driver. Grabbing didn't cause problems back then but now that the input subsystem is used by rfkill/acpi/etc. functionalitys is lost when the devices are grabbed.

Also note that some (root-launched) daemons like brltty would like to be notified of some given keyboard shortcut. What they end up doing for now is grabbing all the keyboard, and re-emiting all the keys through a uinput.

Samuel