Page 1 of 1

curious keyboard scan codes

Posted: Sat Aug 23, 2008 3:15 pm
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.

Re: curious keyboard scan codes

Posted: Sat Aug 23, 2008 8:53 pm
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).