lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090915183406.GA5696@core.coreip.homeip.net>
Date:	Tue, 15 Sep 2009 11:34:06 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Trilok Soni <soni.trilok@...il.com>
Cc:	"Rick L. Vinyard, Jr." <rvinyard@...nmsu.edu>,
	Linux USB <linux-usb@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>, linux-input@...r.kernel.org
Subject: Re: Using EV_MSC or extending KEY_*

On Tue, Sep 15, 2009 at 10:41:30PM +0530, Trilok Soni wrote:
> Adding linux-input.
> 
> On Tue, Sep 15, 2009 at 9:49 PM, Rick L. Vinyard, Jr.
> <rvinyard@...nmsu.edu> wrote:
> > On the Logitech G13 there are a set of 10 special keys at the top of the
> > device.
> >
> > I've written the driver so that it maintains a map from the general keys
> > (G1-G22) to Linux' input subsystem keys.
> >
> > The map can be changed on the fly, allowing multiple keymaps to be loaded.
> >
> > As a side note I haven't provided for this functionality (multiple
> > keymaps) in the driver since this can be maintained from userspace, but it
> > does need to know about the currently loaded keymap so that when the raw
> > HID events are parsed the appropriate EV_KEY events can be input.
> >
> > I could set it up so that the special keys also map to a KEY_* code.
> > However, I'd prefer to set things up so that any G1-G22 key can be mapped
> > to any input subsystem KEY_* code and not reserve a set of 10 from the
> > current KEY_* codes for the 10 special keys.
> >
> > One way I was thinking of approaching this was to generate EV_MSC type
> > events (with a MSC_RAW code) using the value to indicate the state
> > (pressed/released) and special key.

Doesn't HID already generate EV_MSC/MSC_SCAN for exactly this purpose
so userspace knows what keys can be remapped? You may initially map all
keys you don't know the usage to KEY_UNKNOWN.

> >
> > Another way to approach this would be to extend the KEY_* #defines with a
> > special set of 10 codes for the 10 special keys.
> >

No, please don't do this.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ