[vbox-dev] How-to put keyboard scancodes ?

Vitali Pelenjow Vitali.Pelenjow at oracle.com
Fri Mar 11 01:20:18 PST 2011


You forgot to send a release scancode. See 
http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html for information on 
scancodes.

To press and release the CapsLock:
console.keyboard.putScancode(0x3a)
console.keyboard.putScancode(0xba)

For 'q':
console.keyboard.putScancode(0x10)
console.keyboard.putScancode(0x90)

The putScancode is of course a low level API. If you need a user 
friendly wrapper, which will be able to take key names like 'tab', 
contribute it.

Alexey Eromenko wrote:
> Simple scancodes work fine, such as sending "q" letter:
> console.keyboard.putScancode(0x10)
>
> But how to put, say, caps lock, then "Q", then caps lock again, and small "q" ?
> # caps lock pressed, locked
> console.keyboard.putScancode(0x3a)
> # 'Q' should be sent
> console.keyboard.putScancode(0x10)
> # caps lock pressed, unlocked
> console.keyboard.putScancode(0x3a)
> # 'q' should be sent
> console.keyboard.putScancode(0x10)
>
> This doesn't work. What's wrong ?
>    





More information about the vbox-dev mailing list