linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: David Christen <davidchristen@gmail.com>
Cc: linux-input@vger.kernel.org
Subject: Re: Enable addition function keys
Date: Tue, 24 May 2011 10:52:38 -0700	[thread overview]
Message-ID: <20110524175238.GA16908@core.coreip.homeip.net> (raw)
In-Reply-To: <BANLkTikH1kzGVqnqF=9uyZHRkWEK3ErURA@mail.gmail.com>

On Tue, May 24, 2011 at 07:39:22PM +0200, David Christen wrote:
> >>
> >> Dear Dmitry,
> >>
> >> I'm starting to feel stupid. I tried a simple code doing some ioctl
> >> calls using EVIOCSKEYCODE  and EVIOCGKEYCODE. But it does not appear
> >> to work. If I run it using ./ioctl-test /dev/input/event0 I get lots
> >> of complains about wrong arguments:
> >>
> >> ====
> >> evdev ioctl: Invalid argument
> >> [0]= 125, [1] = 0
> >> evdev ioctl: Invalid argument
> >> [0]= 126, [1] = 0
> >> evdev ioctl: Invalid argument
> >> [0]= 127, [1] = 0
> >> evdev ioctl: Invalid argument
> >> [0]= 128, [1] = 0
> >> evdev ioctl: Invalid argument
> >> [0]= 129, [1] = 0
> >> evdev ioctl: Invalid argument
> >> Testing changes
> >> evdev ioctl: Invalid argument
> >> [0]= 49, [1] = 49
> >> evdev ioctl: Invalid argument
> >> [0]= 50, [1] = 49
> >
> > The "scancode" for USB HID devices is full usage code (32 bit), so to
> > remap 'M' to 'N' I think you need to issue EVIOCSKEYCODE for
> > usage 0x00070010 (I think) and keycode 49 (KEY_N).
> >
> > BTW, this requires somewhat recent kernel. What kernel are you using?
> >
> Dear Dmitry,
> 
> So you mean it should say:
> 
> 	codes[0] = 0x00070010 ; /* M keycap */
> 	codes[1] = 49; /* assign to N */

Yes.

> 
> 	if(ioctl(fd, EVIOCSKEYCODE, codes)) {
> 		perror("evdev ioctl");
> 	}
> 
> 
> > P.S. In your program you call EVIOCSKEYCODE twice. I believe the 2nd
> > time, when you test, you want to call EVIOCGKEYCODE.
> >
> >
> 
> Yes, you were right. Please find the corrected file attached.
> 
> But it seems that the behavior is exactly the same.
> 
> The kernel I use is 2.6.33 . It's a debian distro running on a risc processor.

I am afraid you need 2.6.38. Or you'll have to backport the following
commits:

8613e4c Input: add support for large scancodes
ab4e019 Input: define separate EVIOCGKEYCODE_V2/EVIOCSKEYCODE_V2
de391d1 Input: fix typo in keycode validation supporting large scancodes
a0bf0ea Input: hid-input - switch to using new keycode interface
f5854fa Input: hid-input - allow mapping unknown usages

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

  reply	other threads:[~2011-05-24 17:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-16 19:54 Enable addition function keys David Christen
2011-05-24  6:22 ` Dmitry Torokhov
2011-05-24 11:30   ` David Christen
2011-05-24 16:27     ` David Christen
2011-05-24 16:49       ` Dmitry Torokhov
2011-05-24 17:39         ` David Christen
2011-05-24 17:52           ` Dmitry Torokhov [this message]
2011-05-24 18:03             ` Thadeu Lima de Souza Cascardo
2011-05-25  9:48               ` David Christen

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=20110524175238.GA16908@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=davidchristen@gmail.com \
    --cc=linux-input@vger.kernel.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).