From: "Rick L. Vinyard, Jr." <rvinyard-qcTL/1vZYtiVc3sceRu5cw@public.gmane.org>
To: Dmitry Torokhov
<dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Trilok Soni <soni.trilok-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Linux USB <linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Using EV_MSC or extending KEY_*
Date: Tue, 15 Sep 2009 13:05:57 -0600 [thread overview]
Message-ID: <0debc76f26fe85e28adf642396233928.squirrel@intranet.cs.nmsu.edu> (raw)
In-Reply-To: <20090915183406.GA5696-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
Dmitry Torokhov wrote:
> 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-qcTL/1vZYtiVc3sceRu5cw@public.gmane.org> 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.
As I understand it the EV_MSC/MSC_SCAN is used to trigger a prompting of
the user to map a key, which would be useful for the G1-G22 keys and
perhaps 5 of the 10 special keys. But, that's not the behavior I want for
the M1, M2, M3, MR and backlight keys.
Somehow they need to be distinct from any existing KEY_* codes or not have
a code at all... i.e. only emitting the raw misc events.
Perhaps the BTN_MISC codes are better suited for these keys?
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-09-15 19:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <aac07123ee2b14a0ac25d1652dbe0780.squirrel@intranet.cs.nmsu.edu>
2009-09-15 17:11 ` Using EV_MSC or extending KEY_* Trilok Soni
[not found] ` <5d5443650909151011k4b21a6d0n28ac6142c3d7161d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-09-15 18:34 ` Dmitry Torokhov
[not found] ` <20090915183406.GA5696-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2009-09-15 19:05 ` Rick L. Vinyard, Jr. [this message]
2009-09-16 2:19 ` Henrique de Moraes Holschuh
2009-09-16 21:27 ` Rick L. Vinyard, Jr.
2009-09-16 3:46 ` Dmitry Torokhov
2009-09-16 21:27 ` Rick L. Vinyard, Jr.
2009-09-17 17:57 ` Henrique de Moraes Holschuh
2009-09-18 6:46 ` Dmitry Torokhov
2009-09-18 13:56 ` Henrique de Moraes Holschuh
2009-09-18 16:00 ` Rick L. Vinyard, Jr.
[not found] ` <20090918135601.GA25109-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
2009-09-28 17:03 ` Dmitry Torokhov
[not found] ` <20090918064627.GG18668-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2009-09-18 15:40 ` Rick L. Vinyard, Jr.
2009-09-28 17:03 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0debc76f26fe85e28adf642396233928.squirrel@intranet.cs.nmsu.edu \
--to=rvinyard-qctl/1vzytivc3sceru5cw@public.gmane.org \
--cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=soni.trilok-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).