nilsso Posted July 20, 2017 Posted July 20, 2017 Im new to autoit. I guess i can just open a txt file and save it as au3 right? My question is: How do I bind 1 key to press 2 keys at the same time first down then up Send{123}, but how do i bind it to a key? Thanks
nilsso Posted July 20, 2017 Author Posted July 20, 2017 Update: Im trying to make a script that sends RWIN and + bound to a key. But i get an error, this is the script: Send ("{RWIN}{+}"NUMPADADD) Need some help thanks
nilsso Posted July 20, 2017 Author Posted July 20, 2017 Just now, InunoTaishou said: Take out the NUMPADADD Where do I put it? I want to bind clicking right windows and "+" to numbpadadd. Thanks!
InunoTaishou Posted July 20, 2017 Posted July 20, 2017 I think you mean you want the numpad + to be the hotkey and when it's pressed to send Right Window and +? Then you need to do this HotKeySet("{NUMPADADD}", SendCombo) While (True) Sleep(100) Wend Func SendCombo() Send("{+}{RWin}") End Func
nilsso Posted July 20, 2017 Author Posted July 20, 2017 8 minutes ago, InunoTaishou said: I think you mean you want the numpad + to be the hotkey and when it's pressed to send Right Window and +? Then you need to do this HotKeySet("{NUMPADADD}", SendCombo) While (True) Sleep(100) Wend Func SendCombo() Send("{+}{RWin}") End Func Would this work as well? HotKeySet("{NUMPADADD}") Send ("{RWIN}{+}")
nilsso Posted July 20, 2017 Author Posted July 20, 2017 I managed to get it to work: HotKeySet("{NUMPADADD}") Send ("{RWINDOWN}{+DOWN}") Sleep(100) Send ("{RWINUP}{+UP}") Now, I open the program and it zooms my windows, but only 1 time, how do I make it so when I press numpadadd it does it? Thanks.
Moderators JLogan3o13 Posted July 21, 2017 Moderators Posted July 21, 2017 @nilsso the question no one has asked yet is exactly what are you trying to accomplish? I would guess some sort of zooming in an application, which one? Often the app has some of these controls built in, and there will be a much easier way to do it than with Send, which are inherently unreliable. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
nilsso Posted July 21, 2017 Author Posted July 21, 2017 Ive tried and asked, i want windows zoomer to be bound to + - on the numpad and a active hotkey when i press it. Is that possible to achieve?
Moderators JLogan3o13 Posted July 21, 2017 Moderators Posted July 21, 2017 And my question remains. When you say "windows zoomer", what exactly do you mean - setting the zoom within a specific application, or on the Windows desktop? Because how you go about it changes based on the answer to that question. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
nilsso Posted July 21, 2017 Author Posted July 21, 2017 1 hour ago, JLogan3o13 said: And my question remains. When you say "windows zoomer", what exactly do you mean - setting the zoom within a specific application, or on the Windows desktop? Because how you go about it changes based on the answer to that question. The windows 10 zoom application. Its simply zooming in and out by pressing + or - on the numpad.
Developers Jos Posted July 21, 2017 Developers Posted July 21, 2017 I guess you mean the Windows Zooming function instead of app? In general the zoomlevels is changed in any Application with these keys combinations: Send("^{NUMPADADD}") Send("^{NUMPADADD}") sleep(2000) Send("^{NUMPADSUB}") Send("^{NUMPADSUB}") Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
InunoTaishou Posted July 21, 2017 Posted July 21, 2017 (edited) I think he's talking about the Magnifying tool installed on Windows. The Windows key and + (add sign) will increase the magnification by 100%, even if the program is not open. HotKeySet("{NUMPADADD}", IncreaseZoom) HotKeySet("{NUMPADSUB}", DecreaseZoom) HotKeySet("{ESC}", Close) While (True) Sleep(100) Wend Func Close() Exit EndFunc Func IncreaseZoom() Send("{RWIN DOWN}{+ DOWN}{+ UP}{RWIN UP}") EndFunc Func DecreaseZoom() Send("{RWIN DOWN}{- DOWN}{- UP}{RWIN UP}") EndFunc (Had to make it do the + down then up because windows wasn't recognizing that it was being pressed, but this works. Hopefully this is what OP is referring to.... Edited July 21, 2017 by InunoTaishou
nilsso Posted July 21, 2017 Author Posted July 21, 2017 When i compile that script i get an parsing error Taishou. Not sure why. Will that make the - + button as active hotkeys and not just make it zoom in or out one time when u open the program? Thanks.
InunoTaishou Posted July 21, 2017 Posted July 21, 2017 You're not sure why....? The compiler will tell you the error and the line it occurred on. My copy/paste messed up and the second HotKeySet is completely messed up. Just change HotKeySet("{NUMPADSUB}", ) To HotKeySet("{NUMPADSUB}", DecreaseZoom)
nilsso Posted July 21, 2017 Author Posted July 21, 2017 Yes, that seems to do it! Thank u I didnt realize it gave me the error in the error lining, my bad. Yeah, the copypaste fucked up somehow. Now it works as inteded. Is there a way to shorten the script down a bit? As mine is only like 4 lines and it would make it easier for me to learn with a smaller easier setup. thank u. Would this work?: HotKeySet("{NUMPADADD}") Send ("{RWINDOWN}{+DOWN}") Sleep(100) Send ("{RWINUP}{+UP}") HotKeySet("{NUMPADSUB}") Send ("{RWINDOWN}{-DOWN}") Sleep(100) Send ("{RWINUP}{-UP}")
Developers Jos Posted July 21, 2017 Developers Posted July 21, 2017 Did you try? You'll know this won't work like that. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
nilsso Posted July 21, 2017 Author Posted July 21, 2017 1 hour ago, Jos said: Did you try? You'll know this won't work like that. Jos I am at work, I wouldnt ask if i could try it. I was wondering if the script looks good or not
Developers Jos Posted July 22, 2017 Developers Posted July 22, 2017 (edited) No it doesn't, you will find out when you try and debug that the script will end after a little more than 200 mSecs. Jos Edited July 22, 2017 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
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