Jump to content
Sign in to follow this  
bggashnik

HotKeySet problem

Recommended Posts

bggashnik

I realise that HotKeySet function is valid for all other windows while the script is running.When I run the program and just enter an url in the address bar of my browser the HotKeySet function for ENTER button activates in the script.How can i avoid this?

Share this post


Link to post
Share on other sites
Gestalt

I realise that HotKeySet function is valid for all other windows while the script is running.When I run the program and just enter an url in the address bar of my browser the HotKeySet function for ENTER button activates in the script.How can i avoid this?

Change your script to use Alt+Enter instead. Or Ctrl+Enter or Shift+Enter, etc.

Share this post


Link to post
Share on other sites
Nahuel

I find that pretty annoying too, but it's very useful most of the times. I don't know if there's an easier/more efficient way of doing it, but this is what I thought:

#include <GUIConstants.au3>

$Form1 = GUICreate("My Gui", 349, 174, 208, 128)
GUISetState(@SW_SHOW)


While 1
    If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
    If WinActive($Form1) Then
        HotKeySet("a","hello")
    Else
        HotKeySet("a")
    EndIf
WEnd

Func hello()
    MsgBox(0,"","hello")
EndFunc

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  

×