curious keyboard scan codes

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
wndproc
Posts: 20
Joined: Sat Feb 02, 2008 3:02 pm
Location: Austria

curious keyboard scan codes

Post by wndproc »

Hi again,
I recently tried to capture cursor key input for a textbox, but I get really weired scan codes. I read that some unprintable keys send the escape scan code 0xE0, but my keys apparently wanna be unique.

This is what I get:

Left cursor key:
KeyDown (MS Virtual PC): 0x40, 0x20, 0x40, 0xE1
KeyUp (MS Virtual PC): 0x40, 0x00, 0x40, 0x08
KeyDown (Bochs): 0x40, 0xF1
KeyUp (Bochs): 0x40, 0x00

Right cursor key:
KeyDown (MS Virtual PC): 0x40, 0x20, 0x40, 0x00
KeyUp (MS Virtual PC): 0x40, 0x8E, 0x40, 0x08
KeyDown (Bochs): 0x40, 0x00
KeyUp (Bochs): 0x40, 0x8E

Up cursor key:
KeyDown (MS Virtual PC): 0x40, 0x20, 0x40, 0x00
KeyUp (MS Virtual PC): 0x40, 0x40, 0x40, 0x08
KeyDown (Bochs): 0x40, 0x00
KeyUp (Bochs): 0x40, 0x40

Down cursor key:
KeyDown (MS Virtual PC): 0x40, 0x20, 0x40, 0x00
KeyUp (MS Virtual PC): 0x40, 0x40, 0x40, 0x08
KeyDown (Bochs): 0x40, 0x00
KeyUp (Bochs): 0x40, 0x40

(My keyboard is a "Standard 101/102-Key or Microsoft Natural PS/2 Keyboard")

Particularly thought-provoking the is the fact that the keys UP and DOWN are 100% the same!
Please help me out.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: curious keyboard scan codes

Post by bewing »

Which scancode set are you supposedly using?

Basically, these codes look impossible, which means that there is something wrong with your scancode-retrieval code.

We are probably going to need to see your code, and some examples of scancodes from text keys (ASDF).
Post Reply