View Single Post
Old 04-07-2019, 07:54 PM
hastegag hastegag is offline
Registered User
hastegag's PC Specs
Join Date: Dec 2016
Location: Northeast US
Posts: 982
POST ID # = 1000701
hastegag Reputation: 20

for the macro keys, which i dont think your model has, you can use the SDK to do this, but there's no held length of time control I am aware of ... in some part because you could end up switching profiles during the held keypress.

If you would like Autohotkey to do this, there are a couple ways to achieve it, but they would require iCUE to remap the lock key to emit some other keypress.

The better option inside icue is for say a modifier key to temporarily switch profiles (say ctrl?) and then the lock button in your ctrl profile can just to the action to kill the VPN process.

If you do not have the physical ability to press both keys or would rather know how to avoid that, or avoid using cue to switch profiles first, then AHK can definitely fill in there. If you set iCUE to remap the lock button to a key that isnt one on your keyboard, like F13, then you can have Auothotkey sniff for F13:: as a hotkey and either use a toggle or a held timer with something like:

     if (A_TimeSincePriorHotkey < 500 && (A_PriorHotkey = A_ThisHotkey))
         vpnClose() ;you need to write this
else {
     vpnOpenIfNotOpen() ; you also need to write this
Reply With Quote