Sign in to follow this  
Followers 0
jonathan2133

sending keys?

9 posts in this topic

#1 ·  Posted (edited)

Is there a way to get autoit to tell me what key is pressed? i tried making hotkeys for + and -... hold on i will post some stuff...

i hope this works...

HotKeySet("{+}", "add")
HotKeySet("{-}", "subtract")

do
;followed by a short do statment, and my functions below
until 1 = 2

Func add()
;some stuff here
EndFunc

Func subtract()
;more stuff here
EndFunc

It doesnt seem to be working. Is there a way to get autoit to tell me what key is pressed? and is there numeric locations, like can i tell it to press key number 12, or key 22, to differentiate between lft shift and right shift, or numpad numbers vs the other numbers?

thanks :P

Edited by Larry

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Check the helpfile under Send.

Thats the first thing i did. It doesnt have anything that i could find thats relevent to my problem.

Ok try this... make + and/or - a hotkey. Make it do somthing like add to a value. Now make it display that value via a tooltip or somthing of the like.

HotKeySet("{+}", "test")
$test = 1


Do
tooltip ( $test , 0 , 0)
sleep (50)
until 1 = 2

Func test()
$test = $test + 1
EndFunc

try that. See what you get...

Edited by jonathan2133

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Ok this isnt for a keylogger... well it sort of is... lol

Man i am being vague...

I want to know what keys im pressing to be able to know what keys to send for my program. Im trying to make it use + and - as a hotkey for a program, but when i do that it makes a ding and thats it. So i wanted to see if anyone had somthing that would tell me what key i have pressed, so i can use that to tell the program what the hotkey is. If that makes more sense.

Also i wanted to know if tehres a way to differentiate between the numberpad and the line of numbers, because sometimes they do different things... like 7 on the numberpad is different than 7 above Y/U keys. And Left shift is different from Right shift.

I hope this makes things easier.

PS - the last bit of code is the basics of what im trying to do, but when i try it all it does is make a ding sound, and nothing happens. I posted the code to see if somone could help find out why its dinging...

Edited by jonathan2133

Share this post


Link to post
Share on other sites

Check the helpfile under Send. Search for "Numpad" there.

man am i an idoit. lol. Completely missed it. twice.

so instead of

HotKeySet("{+}", "test")
$test = 1


Do
tooltip ( $test , 0 , 0)
sleep (50)
until 1 = 2

Func test()
$test = $test + 1
EndFunc

it should be

HotKeySet("{NUMPADADD}", "test")
$test = 1


Do
tooltip ( $test , 0 , 0)
sleep (50)
until 1 = 2

Func test()
$test = $test + 1
EndFunc

man i feel dumb now... lol. thanks.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

one last thing... i have a euro key and a dollar key near my arrows on my laptop... is there a way to find out how to use those as hotkeys?

Edited by jonathan2133

Share this post


Link to post
Share on other sites

I think that the tool AU3Recorder will help you a lot. You can find it in SciTE under tools if you save your file as .au3 . It basically let s you record macros. It gives you a dirty code , but it is a perfect start. You can see in it what keys have need pressed, where the mouse has clicked, and stuff like that.

Give it a try.

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  
Followers 0