Jump to content

Hotkeyset detect keys while winkey held down?


fisofo
 Share

Recommended Posts

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!

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...