Lord Zion Posted May 17, 2006 Share Posted May 17, 2006 I wrote a simple script that looks like this: HotKeySet("^{SPACE}", "Window") HotKeySet("^{BACKSPACE}", "Fullscr") While 1 Sleep(500) WEnd Func Window() WinActivate("Untitled - Notepad", "") WinMove("Untitled - Notepad", "", 0, 0, 200, 200) EndFunc Func Fullscr() WinActivate("Untitled - Notepad", "") WinMove("Untitled - Notepad", "", 0, 0, @DesktopWidth, @DesktopHeight) EndFunc I just can't figure it out how to make a toggle hotkey... in this case i would just like to use ^{SPACE} to toggle between the 2 modes. I think its pretty simple for you guys to make this change. Thx a lot. Link to comment Share on other sites More sharing options...
Valuater Posted May 17, 2006 Share Posted May 17, 2006 HotKeySet("^{SPACE}", "Window") Dim $t = 0 While 1 Sleep(100) WEnd Func Window() If $t = 0 Then WinActivate("Untitled - Notepad", "") WinMove("Untitled - Notepad", "", 0, 0, 200, 200) $t = 1 Else WinActivate("Untitled - Notepad", "") WinMove("Untitled - Notepad", "", 0, 0, @DesktopWidth, @DesktopHeight) $t = 0 EndIf EndFunc 8) Link to comment Share on other sites More sharing options...
Lord Zion Posted May 17, 2006 Author Share Posted May 17, 2006 OMG i fell sooooo stupid because its so simple ! Thank you ! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 17, 2006 Moderators Share Posted May 17, 2006 (edited) OMG i fell sooooo stupid because its so simple ! Thank you !Another way to do it:HotKeySet("^{SPACE}", "Window") Global $t While 1 Sleep(100) WEnd Func Window() $t = Not $t If $t Then WinActivate("Untitled - Notepad", "") WinMove("Untitled - Notepad", "", 0, 0, 200, 200) Else WinActivate("Untitled - Notepad", "") WinMove("Untitled - Notepad", "", 0, 0, @DesktopWidth, @DesktopHeight) EndIf EndFunc P.S. - This is the scripts and scraps forum Edit: Fixed Code Tags Edited May 17, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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