[Open] Send {Tab} won't invoke OnFocus. Need SetKeyDelay?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
RobertL
Posts: 546
Joined: 18 Jan 2014, 01:14
Location: China

[Open] Send {Tab} won't invoke OnFocus. Need SetKeyDelay?

01 Nov 2015, 06:34

Code: Select all

Gui,Add,Edit,w100
Gui,Add,Edit,w100 hwndh, ToolTip when get focus
Gui,Show
OnMessage(WM_COMMAND:=0x111,"f")
return
a::Send {Tab}
f(w,l){
	global h
	if((l=h) && ((w>>16)=0x0100)) ;EN_SETFOCUS
		ToolTip SetFocus
}
GuiClose:
ExitApp
Use a to send tab, won't invoke the message. But these could
  • a::Tab which use SetKeyDelay -1. SendPlay use SetKeyDelay -1, but can't neither.
  • Put a::Send {Tab} in another script (new process).
Why?

I want to focus on next tab-order control, and let GUI to get message.
Last edited by RobertL on 02 Nov 2015, 19:38, edited 6 times in total.
我为人人,人人为己?
MJs
Posts: 454
Joined: 23 Sep 2014, 03:29

Re: Send {Tab} won't invoke OnFocus

01 Nov 2015, 13:02

I don't know why, even though using Spy++ shows that the window received the message.

just an idea:
you can send the message direcly to the edit control, get the parent window list of controls, and the edit controls ID in the gui and send the WM_COMMAND with the EN_SETFOCUS notification
but this needs some control over how the controls are tabbed, so you can set a conditional hotkey.
User avatar
RobertL
Posts: 546
Joined: 18 Jan 2014, 01:14
Location: China

Re: [Open] Send {Tab} won't invoke OnFocus. Need SetKeyDelay?

02 Nov 2015, 19:35

@MJs
I found if put a::Send {Tab} in another script (new process), it would work.
And I'm afaid that send messages internal won't invoke complete procedure, need send KillFocus (if it be monitored too) and some other chain message all myself?

Thank you.
我为人人,人人为己?
MJs
Posts: 454
Joined: 23 Sep 2014, 03:29

Re: [Open] Send {Tab} won't invoke OnFocus. Need SetKeyDelay?

03 Nov 2015, 06:04

is it to be send internally? like you need to send keys in your own GUI

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Joey5, RandomBoy and 362 guests