Vegar Posted May 23, 2009 Share Posted May 23, 2009 Hello.. with a Hotkey How could i send a keystroke (Ctrl+{Right}) to another window without opening that window? Link to comment Share on other sites More sharing options...
Bert Posted May 23, 2009 Share Posted May 23, 2009 Please use the search function in the forum. This question has been answered many times, and you may find in your search just the method you like. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Tinutron Posted May 23, 2009 Share Posted May 23, 2009 You can do this using ControlSend. Read the helpfile for more information. Link to comment Share on other sites More sharing options...
Vegar Posted May 23, 2009 Author Share Posted May 23, 2009 I've tried this but i dont get it to work but i'l try to explane better... If i have the Spotify (music program) window active on the screen and push the buttons: Ctrl+{Right} then it changes song... but when i have another window open/Active this hotkey does not work.. And i want this hotkey to work even do i have another window open.. ive tried the Controlsend, but i just do not get it to work :S Link to comment Share on other sites More sharing options...
Tinutron Posted May 23, 2009 Share Posted May 23, 2009 Does the titel of your musicplayer change, when another song is playing? And can you maybe post some code? Link to comment Share on other sites More sharing options...
Vegar Posted May 23, 2009 Author Share Posted May 23, 2009 Yes i changes for each songHotkeyset ("^{RIGHT}","Right")while 1 sleep (10)wendFunc Right ()ControlSend("Spotify", "", "", "^{LEFT}")EndFunc Link to comment Share on other sites More sharing options...
Tinutron Posted May 23, 2009 Share Posted May 23, 2009 So if it changes, you cant just use "spotify" as its title, or am i wrong? Link to comment Share on other sites More sharing options...
Vegar Posted May 23, 2009 Author Share Posted May 23, 2009 yesh i think that would work?!?! or? Link to comment Share on other sites More sharing options...
AgentSmith15 Posted May 23, 2009 Share Posted May 23, 2009 Every post you make is "How do I do this".... I don't think anyone's going to write it for you. [center][/center] Link to comment Share on other sites More sharing options...
oMBRa Posted May 23, 2009 Share Posted May 23, 2009 Hotkeyset ("^{RIGHT}","Right") while 1 sleep (10) wend Func Right () $a = ControlSend("Spotify", "", "", "^{LEFT}") msgbox(0, '', $a) EndFunc if $a = 0 then the window title is wrong... Link to comment Share on other sites More sharing options...
Vegar Posted May 23, 2009 Author Share Posted May 23, 2009 (edited) Hmm, i got it to work to some degree...it changes the song but it seems like it holds Ctrl in, so it is imposible to do anything else on the computer..??and the "Space" Func does not work!?!, i dont know why...and the "Up"/"Down" Func is ment to adjust the volume, but i cant just hold the Ctrl button, i must push the button for each step.. why so? Hotkeyset ("^{RIGHT}","Right")Hotkeyset ("^{LEFT}","Left")Hotkeyset ("^{UP}","Up")Hotkeyset ("^{DOWN}","Down")Hotkeyset ("^{SPACE}","space")while 1sleep (10)wendFunc Right ()$a = ControlSend("Spotify", "", "", "^{RIGHT}")EndFuncFunc Left ()$b = ControlSend("Spotify", "", "", "^{LEFT}")EndFunc Func Up ()$c = ControlSend("Spotify", "", "", "^{UP}")EndFuncFunc Down ()$d = ControlSend("Spotify", "", "", "^{DOWN}")EndFuncFunc Space ()$e = ControlSend("Spotify", "", "", "{SPACE}")EndFunc Edited May 23, 2009 by Vegar Link to comment Share on other sites More sharing options...
Developers Jos Posted May 23, 2009 Developers Share Posted May 23, 2009 Stop deleting posts and reentering the same information to bump your thread. 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. Link to comment Share on other sites More sharing options...
Vegar Posted May 23, 2009 Author Share Posted May 23, 2009 Is not that better than writing "Bump" in a new post? Link to comment Share on other sites More sharing options...
Authenticity Posted May 23, 2009 Share Posted May 23, 2009 You can add additional function or the same lines in every function to loop until the ctrl key is released. #include <Misc.au3> $hDll = DllOpen('user32.dll') ;.... ;.... Func OnAutoItExit() DllClose($hDll) EndFunc Func CtrlRelease() While _IsPressed('11', $hDll) Sleep(50) WEnd EndFunc Func Hoyre () CtrlRelease() $a = ControlSend("Spotify", "", "", "^{right}") EndFuncoÝ÷ Úò¢çǧuËkêr¢êìçÚºÚ"µÍÙ[ ÌÎNÞÐÕTIÌÎNÊ Link to comment Share on other sites More sharing options...
Developers Jos Posted May 24, 2009 Developers Share Posted May 24, 2009 Is not that better than writing "Bump" in a new post?No 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. 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