Jump to content
Sign in to follow this  
krikor

Retreive the Scancode

Recommended Posts

krikor

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

Share this post


Link to post
Share on other sites
this-is-me

Excuse me for asking, but I don't unserstand the question. Please explain the difference between scancode and keycode.


Who else would I be?

Share this post


Link to post
Share on other sites
ezzetabi

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.

Share this post


Link to post
Share on other sites
krikor

<{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?

Share this post


Link to post
Share on other sites
ezzetabi

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

Share this post


Link to post
Share on other sites
krikor

get the "unstable" a.k.a. beta and use this API... "MapVirtualKey"

Lar.

<{POST_SNAPBACK}>

Hi, thanks but where do I download this.

Greg

Share this post


Link to post
Share on other sites
krikor

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

Share this post


Link to post
Share on other sites
killaz219

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

<{POST_SNAPBACK}>

You can do either. If you install it over the old version you'll keep your settings though.

Share this post


Link to post
Share on other sites
layer

i would install over the old ones, so that no confusion comes along.


FootbaG

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.