jonathan2133 Posted September 7, 2006 Share Posted September 7, 2006 (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 Edited September 7, 2006 by Larry Link to comment Share on other sites More sharing options...
lod3n Posted September 7, 2006 Share Posted September 7, 2006 Check the helpfile under Send. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
jonathan2133 Posted September 7, 2006 Author Share Posted September 7, 2006 (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 September 7, 2006 by jonathan2133 Link to comment Share on other sites More sharing options...
jonathan2133 Posted September 7, 2006 Author Share Posted September 7, 2006 (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 September 7, 2006 by jonathan2133 Link to comment Share on other sites More sharing options...
lod3n Posted September 7, 2006 Share Posted September 7, 2006 Check the helpfile under Send. Search for "Numpad" there. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
jonathan2133 Posted September 7, 2006 Author Share Posted September 7, 2006 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. Link to comment Share on other sites More sharing options...
jonathan2133 Posted September 7, 2006 Author Share Posted September 7, 2006 (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 September 7, 2006 by jonathan2133 Link to comment Share on other sites More sharing options...
lod3n Posted September 7, 2006 Share Posted September 7, 2006 I don't think you can use HotKeySet with keys not defined in the help file. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
Pfex Posted September 8, 2006 Share Posted September 8, 2006 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now