Sign in to follow this  
Followers 0
fisofo

Hotkeyset detect keys while winkey held down?

4 posts in this topic

Here's the code:

For $x = 0 to 9
    HotKeySet("#{NUMPAD" & $x & "}", "SplitViewMon")
Next

Func SplitViewMon()
    $i += 1
    Do
        $g=$i
        Sleep(200)

    Until $g==$i
    Switch $i
        Case 1
            Send("!{NUMPAD" & Number(StringMid(@HotKeyPressed, 9, 1)) & "}")
        Case Else
            Send("^`")
    EndSwitch
    $i = 0
EndFunc

In case anyone is wondering, i'm using this software in conjunction with Splitview and Ultramon. When a key is pressed once, it sends a hotkey that splitview picks up and moves a window to a side of the screen. When a key is pressed twice, it sends a hotkey that ultramon picks up and it whips the window to the next monitor.

Anyway, It works just fine if I press the windows key and hit a numpad number... but i was hoping it would detect a key pressed again while still holding the windows key. For example:

-I press #,

-then I press and release {NUMPAD5}

-The script runs

-While still holding #, I press {NUMPAD7}

-script doesn't run, it sends a 7 to the active window. Can I get this to run the script again?

Thanks!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Do

$g=$i

Sleep(200)

Until $g==$i

that looks familiar :whistle:

try Disabling hotkeys just before the switch and reset after.

also "case else" does Send("^`") depending on how many times you pressed it, is that what you want to happen

edit: gave wrong info

Edited by Cue

Share this post


Link to post
Share on other sites

one more thing

instead of

Send("!{NUMPAD" & Number(StringMid(@HotKeyPressed, 9, 1)) & "}")

u can use

Send("!"&StringTrimLeft ( @HotKeyPressed, 1))

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Do

$g=$i

Sleep(200)

Until $g==$i

that looks familiar :whistle:

try Disabling hotkeys just before the switch and reset after.

also "case else" does Send("^`") depending on how many times you pressed it, is that what you want to happen

edit: gave wrong info

Yes, thank you Cue ;)

shoot... just realized my selection of keys conflicts with something else... but thanks for the suggestions, i'll try it out. Oh, and yes, the case else is functioning how i want it to... thanks for the help!

Edited by fisofo

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