Sign in to follow this  
Followers 0
confucion

global dynamic hotkeys?

5 posts in this topic

Is it possible to change the global hotkeys depending on which application window is focused?

Like if I open a new notepad window, ^T would type in the current time for me

then if I open a new word doc, the same ^T would type in my signature whenever I end a letter.

Share this post


Link to post
Share on other sites



Just use winexists, if's to see if a window is open and if it is hotkey the things u need else it doesnt hotkey it

Share this post


Link to post
Share on other sites

yes...

if winRxits("untitled -") then

hotKeySet()

endif

if winRxits("word document???") then

hotKeySet()

endif

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

I have a couple of scripts that do this.

Have your hotkey call a case statement.

Then call different functions from the case statment depending on what window is active.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Do I put the If...Then statement in the main body of the program?

While 1
    Sleep(1000)
WEnd

or outside of it?

I tried using If WinActive but that resulted in an error in the main body. Isn't WinActive more appropriate for this since it checks if the app is frontmost rather than just exisiting amongst all the other windows?

Another thing is that if I set a hotkey to catch +a and want to fireoff sendkey("{UP}") I have to do SHIFT-DOWN-A, SHIFT-DOWN-A, SHIFT-DOWN-A to send 3 {UP} instead of SHIFT-DOWN-AAA

Kind of annoying, is there a workaround?

Edited by confucion

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