Jump to content

Retreive the Scancode


krikor
 Share

Recommended Posts

Hi,

I just downloaded the Autoit. I have no idea about scripting eventhough I'm a programer. I find it great.

I would like to create my first Script but need to detect the scancode of the pressed key. Is there a way to get the scancode insteade of the keycode?

Thanks

Greg

Link to comment
Share on other sites

AFAIK the keycode is a code related to the 'meaning' of the key while the 'scancode' is related about the hardware position of the key.

E.G.

The key ~ in english keyboard returns (of course) a tilde, but in an italian keyboard will return a backslash! Because keyboards are differents. So the keycode will be different, but the scancode does not.

Link to comment
Share on other sites

<{POST_SNAPBACK}>

I couldn't make this run, gets an error here:

$aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)

but GetAsyncKeyState Api will return the Virtual Keycode. Which API should I call and how, in order to obtain the Scancode. from the Keyboard Layout?

Link to comment
Share on other sites

May help.

$ikeyvalue = 27;This is just an example for Esc

$a=DllCall('user32.dll','int','MapVirtualKey','int',$ikeyvalue,'int',0)
MsgBox(0,'Scancode','The scancode is ' & @lf & $a[0])


$iscancode = 1;This is just an example for Esc
$a=DllCall('user32.dll','int','MapVirtualKey','int',$iscancode,'int',1)
MsgBox(0,'Scancode','The keyvalue is ' & @lf & $a[0])

VirtualKeyCodes in hex!

Edited by ezzetabi
Link to comment
Share on other sites

beta version... http://www.autoitscript.com/autoit3/files/...it-v3.0.103.exe

keylogger... http://www.autoitscript.com/forum/index.php?showtopic=6055

EDIT: the keylogger doesnt record every key, sorry, i was too lazy to add all of them because i have a life..

<{POST_SNAPBACK}>

Thanks Layer, I'll try these out. Just one thing. Do I install this over the old version or do I have to Uninstall it first?

Thanks again

Greg

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...