Sign in to follow this  
Followers 0
CyberSlug

Guimsg And Hotkeyset Conflict!

3 posts in this topic

1. Try the code as-is.

2. Try the code but change the marked line to $msg = GuiMsg(0)

Behavior I see (tested with latest build I could get on WinXP Pro sp1):

1 - Tab cycling, and the Alt-underline hotkeys work; BUT the Pause key does not

2 - Tab cycling, Alt-underline hotkeys do NOT work; BUT the Pause hotkey DOES.

HotKeySet("{Pause}", "keyPressed")
  Func keyPressed()
    MsgBox(4096,"","You pressed the Pause hotkey")
  EndFunc

Opt("GUINotifyMode", 1);all controls notify

GuiCreate("MyGUI", 300, 200)
$input_1 = GUISetControl("input", "Try pressing Alt+F, Tab, Pause, etc..", 0, 0, 200, 20)
$button_1 = GUISetControl("button", "&Test", 0, 50, 100, 20)
  GUISetControlEx ( $button_1, 256);initial focus on this button
$button_2 = GUISetControl("button", "&Foo", 0, 90, 100, 20)
GuiShow()
WinActivate("MyGUI")

While 1
   sleep(100)
   $msg = GuiMsg() ;CHANGE THIS LINE

   If $msg = -3 Then Exit
   If $msg = $button_1 Then MsgBox(4096,"","Button 'Test' pressed")
   If $msg = $button_2 Then MsgBox(4096,"","Button 'Foo' pressed")
WEnd

:D It took me quite a while to track down this behavior. For now, I can use GuiMsg(0) and am hard-coding the tab-cycling and Alt-button hotkeys.

Is there any way that both the native gui hotkeys (tab-cycling, Alt-stuff) and HotKeySet keys can work right?


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites



I pointed this out a long time ago. GuiMsg() blocks completely just like MsgBox or the like.

Share this post


Link to post
Share on other sites

I pointed this out a long time ago.  GuiMsg() blocks completely just like MsgBox or the like.

:D Oops. Guess I should have searched the forums first. Thanks

I'll add it to my to-document-and-eventually-submit-to-jpm list


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

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