|
|
Can I read the keyboard in two modes simultaneously?
Hi. I'm wondering if there's any way in a C program on
linux to use ioctl() or similar to get both the raw
keypresses (keydown and keyup indicating which physical
keyboard button was pressed) and the translated characters
generated.
My application is a "roguelike" game interface with
a lot of keys mapped to various commands. I want
keypress messages so I can tell the difference between
the number pad, the arrow keys, and the number row
above the keyboard, and translated characters so I can
respond appropriately when the user pushes a "letter key"
or composes a letter using their altgr or whatever, no
matter where that letter is mapped on his/her particular
keyboard.
Any help would be appreciated.
Thanks,
Bear
|
|
0
|
|
|
|
Reply
|
bear (1215)
|
8/4/2007 1:06:12 AM |
|
> Hi. I'm wondering if there's any way in a C program on
> linux to use ioctl() or similar to get both the raw
> keypresses (keydown and keyup indicating which physical
> keyboard button was pressed) and the translated characters
> generated.
<snip>
Off the cuff, I would say it should indeed be possible, but it would
probably require a bit of work on your part. You either need a key-
mapping function that translates keypresses without removing them from
the input buffer, or you need a function that pulls the keypresses,
then passes them to a translator.
|
|
0
|
|
|
|
Reply
|
wild.halcyon (2)
|
8/4/2007 5:13:51 PM
|
|
Ray Dillinger <bear@sonic.net> wrote:
> My application is a "roguelike" game interface with
> a lot of keys mapped to various commands. I want
> keypress messages so I can tell the difference between
> the number pad, the arrow keys, and the number row
> above the keyboard [...]
Drop the numberpad into application mode and then use terminfo(5) to
read the key sequences. No need for the complexity of handling key-downs.
Chris
|
|
0
|
|
|
|
Reply
|
chris-usenet (1110)
|
8/5/2007 11:51:22 PM
|
|
|
2 Replies
44 Views
(page loaded in 0.086 seconds)
Similiar Articles: Keyboard Input - comp.lang.asm.x86> and is not supported > in protected mode. True. And writing a keyboard handler for rmode will ... is the port where keyboard data goes IN AL, 60h ;Read keyboard ... input & output in assembly - comp.lang.asm.x86... programming (read/write files, read keyboard, > write to screen in text/graphics mode). ... Ie. it can execute two instructions simultaneously (provided they did not ... AucTeX math mode in Windows Emacs - comp.emacsI'm using a german keyboard layout and can't get the math mode to work with it. ... And > don't forget to read the doc string. > Thank's alot! That ... Memory Mapped register read/write on USB device - comp.os.ms ...... the USB keyboard as PS/2 one, but this is specific to the = keyboard (and ... windows.programmer.nt.kernel-mode ... fetch or data read/write, read/write memory ... as I can see ... Windows 7 - Keyboard and/or codepage problem - comp.lang.clipper ...... correct on the screen but all READ commands are done with american keyboard layout. What's going on and how can I ... party lib > or the MODE command: > MODE ... Only number input thru scanf() - comp.lang.c... first prompts for a number, then attempts to read in two ... from an interactive device like a keyboard, and keyboard ... things like conio on windows or raw terminal mode ... OpenSSH and .rhosts usage - comp.unix.solaris... host key: #0 type 0 RSA1 debug1: read PEM ... received debug1: Authentications that can continue: publickey,password,keyboard ... tty_parse_modes: 1 3 debug3: tty_parse_modes: 2 ... [comp.publish.cdrom] CD-Recordable FAQ, Part 1/4 - comp.publish ...Archive-name: cdrom/cd-recordable/part1 Posting-Frequency: monthly Last-modified: 2008/10/09 Version: 2.71 Send corrections and updates to And... booting solaris in single user mode with root filesystems read ...... devices Sun Fire 280R (2 X UltraSPARC-III) , No Keyboard ... Single user mode? (I have read the manpage on hpux (1M) and all I can find is that in signle user mode root ... Ubuntu 10.04 full of bugs. Keyboard stops working seems popular ...... processor Pentium D 2.8Ghz, ram 1gb. keyboard a4tech(ps/2),mouse ... I was able to boot into rescue mode. I chose repair ... Read the numbers and wail, Kindergarten Boy. 10.04 ... pressing multiple keys on keyboard problem.... - Other-Components ...... press more than two keys at once. <i ... game in 2 player mode on any other keyboard. unfortunately that keyboard is long gone... i have read praises about an other 2 ... how to record multiple midi tracks simultaneously - Cockos ...I can't find a way to hear several voices at once while playing the keyboard in Multi mode. ... you want when your keyboard is in the right mode. When I read ... 7/24/2012 1:49:39 AM
|
|
|
|
|
|
|
|
|