From: tike64@gmail.com
To: linux-kernel@vger.kernel.org
Subject: KDGKBENT and unicode
Date: Wed, 24 Sep 2008 16:25:08 +0300 [thread overview]
Message-ID: <48DA3FB4.1060207@gmail.com> (raw)
Dear linux-kernel,
I am trying to read keyboard in raw mode (K_MEDIUMRAW, to be exact). I
hope to avoid reading all the keymaps from the kernel to the application
for keycode translation. Therefore I call KDGKBENT ioctl for every
keycode I get from the tty. Basically this works except, when the
translation result is an unicode keysym or should I say the unicode
value happens to be greater than 0xFF, I get K_HOLE.
This observation seems to be in harmony with the drivers/char/vt_ioctl.c
code. There I learned that, if I had the keyboard in the K_UNICODE mode,
I could get directly the 16 bit unicode values.
So I have two options:
1) Read the keymaps in K_UNICODE mode and do the translations myself
while in K_MEDIUMRAW mode
2) For each keycode switch to K_UNICODE mode, ask the translation from
kernel, switch back to K_MEDIUMRAW mode and read the next keycode (the
continuous switching might have severe side effects).
The question is am I correct so far or am I miserably confused? Aren't
there any smarter ways to do the translation?
The next question probably must be how do I handle CAPS with kernel
keymaps? As the CAPS sensitivity is encoded in the type field of keysym
value, it is lost when the value is 16 bit unicode. I am seeing this
phenomenon in ordinary VT when I manage to load some keysyms as 16 bit
unicode.
--
Timo
reply other threads:[~2008-09-24 13:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=48DA3FB4.1060207@gmail.com \
--to=tike64@gmail.com \
--cc=linux-kernel@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