AutoHotkey Community

It is currently May 24th, 2012, 3:09 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Mistery of the ESC key
PostPosted: January 24th, 2007, 3:15 pm 
Offline

Joined: November 25th, 2006, 9:02 am
Posts: 13
Consider this simple script:

Code:
Menu, Tray, NoStandard
Menu, Tray, DeleteAll
Menu, Tray, Add, Show gui, GUISHOW
Menu, Tray, Add, Exit, EXIT
Gui, Add, Edit, R4 w200, Sample text

RControl::Gosub, GUISHOW

GUISHOW:
Gui, Show
Return

GuiClose:
GuiEscape:
Gui, Cancel
Return

EXIT:
ExitApp
Return


You have two options to launch GUISHOW:
1. Right clicking tray icon, then selecting the item "Show gui"
2. Pressing RControl, then selecting the item "Show gui"

Now press ESC to close. If you have chosen option no. 2, ESC has no effect.
Do you know why? :shock:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 24th, 2007, 4:51 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Additional info: once the RControl has been used, you can no longer escape the GUI shown from the menu too...
Mystery for me too, might be a bug, or a limitation.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2007, 7:28 am 
Offline

Joined: November 11th, 2005, 3:13 am
Posts: 202
try this:
Code:
~RControl::Gosub, GUISHOW


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2007, 10:28 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Good trick, it works, but I am not sure why it works...
Oh, I see, the hotkey reacts on the down event and eats the up one, so the control key is stuck down (system doesn't see the up event). Is that so?
With given code, if I hit the left control after the GUI shows up, I can escape it, because I unstuck the key.
Tricky...

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, DetroitAutoHotkey, engunneer, Google Feedfetcher and 26 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group