Sign in to follow this  
Followers 0
ken82m

Hotkey's disabled in other apps?

6 posts in this topic

I've never noticed this before, I'm just wondering if anyone else has seen this or if it's a Windows 7 thing.

I've set several hotkeys and while the script is running those keys won't function in any other application.

Thanks,

Kenny


My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Share this post


Link to post
Share on other sites



hmm well that's annoying lol

Other apps can have keys that only apply to themselves when active.

Would be a nice parameter I think :P


My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Share this post


Link to post
Share on other sites

Found something, hotkeys only function while window is active and keys continue to function elsewhere.

http://www.autoitscript.com/forum/index.ph...2&hl=hotkey


My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Share this post


Link to post
Share on other sites

Simple solution:

HotKeySet("{F1}", "_MyFunc")

$GUI = GUICreate("Hotkey Form", 260, 213, 193, 125)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case -3
            Exit

    EndSwitch
WEnd

Func _MyFunc()
    If WinActive($GUI) Then MsgBox(0, "", "This message will only be shown if the AutoIt GUI is active!")
EndFunc

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Simple solution:

HotKeySet("{F1}", "_MyFunc")

$GUI = GUICreate("Hotkey Form", 260, 213, 193, 125)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case -3
            Exit

    EndSwitch
WEnd

Func _MyFunc()
    If WinActive($GUI) Then MsgBox(0, "", "This message will only be shown if the AutoIt GUI is active!")
EndFunc
That will only get the function to work when the window is active but the same hotkeys in other apps will still be blocked,

also you need to do that for every function that has a hotkey.

When HotKeySet sets a hotkey it is not bound to a GUI so you will have to manage that yourself.

You can use the $WM_ACTIVATEAPP msg to set the hotkeys when the window is active and unset them when it goes inactive.

Global Const $WM_ACTIVATEAPP = 0x001C
GUIRegisterMsg($WM_ACTIVATEAPP, "_HotKeysActive") ; register func for msg, the registered func will be called when the GUI gaines or looses focus

Global $hMyGUI = GUICreate(...)

Func _HotKeysActive()
    If WinActive($hMyGUI) Then
        HotKeySet("!{F4}", "_Exit")
        HotKeySet("{F1}", "_Help")
    Else
        HotKeySet("!{F4}")
        HotKeySet("{F1}")
    EndIf
EndFunc   ;==>_HotKeysActiveoÝ÷ Ø    趫¢b¢x¬BzÐqé^­«h®Æ®¶­sdvÆö&Âb33c¶×uTÒuT7&VFRâââ¢ââà¤vÆö&Âb33c¶ÖVçTWBÒuT7&VFTÖVçTFVÒâââ £²b33c¶ÖVçTWBæBb33c¶ÖVçTVÇ&RæFÆW2FòuT6öçG&öÇ0¤FÒb33c¶uTô66VÅF&ÆU³%Õ³%ÒÒµ²gV÷C²b333·´cGÒgV÷C²Âb33c¶ÖVçTWEÒŲgV÷C·´cÒgV÷C²Âb33c¶ÖVçTVÇÕФuT6WD66VÆW&F÷'2b33c¶uTô66VÅF&ÆR

If you use koda to design your GUI look for HotKey in the Object Inspector (tool) window and then at the bottom of your GUI script after generating :unsure:

And if your help file is an executable you can use GUISetHelp for the Help HotKey (F1)

Hope that explaines it a bit :P

Edited by Robjong

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