Subject: Re: Hotkey support via powerd
To: Jared D. McNeill <jmcneill@invisible.ca>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: tech-kern
Date: 12/22/2007 10:58:17
On Sat, 22 Dec 2007 10:18:17 -0500 (EST)
"Jared D. McNeill" <jmcneill@invisible.ca> wrote:

> Heyas folks --
> 
> The following is a patch I'm using to allow hotkeys to be passed from
> a device driver through to powerd. I'm using it for eg. automatically
> locking my screen when I press Fn+F2, and invoking xrandr to change
> my outputs when I press Fn+F7 on this Thinkpad.

Excellent idea (I look forward to using it), but I have two concerns.

First -- and at this level -- where does the list of hotkeys come
from?  Is that part of some standard or is it vendor- and
model-specific?  For example, I'm pretty certain that on my T42, the
volume control and "Acess IBM" buttons are ACPI events -- at least, I
see things on the screen in Windows when I press them, but xev doesn't
think I've pressed anything.  If they are vendor-specific, the
PSWITCH_HK_* defines are probably inappropriate; we'd need a way to
load the appropriate definitions.  

Second -- we're going to have to figure out some way for powerd to
invoke user-specific scripts, running with the user's permissions.
Realistically, on most NetBSD laptops that's not a big concern, since
the user probably has root, but architecturally it would be nice.  The
more powerd can do, the more important this is.

		--Steve Bellovin, http://www.cs.columbia.edu/~smb