 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
adamrgolf
Joined: 28 Dec 2006 Posts: 362
|
Posted: Wed Jul 23, 2008 10:51 am Post subject: ListView AltSubmit (A_GuiEvent stays on 'Normal' a while) |
|
|
When I select a new row from the example below, I get the tooltip with the file name immediately. If I click that same row again, I do not get the tooltip with the file name immediately. The script sits on the GuiEvent 'Normal' for longer than I would think, then loads my tooltip.
In the example, you'll see the tooltip at x0 y0 showing A_GuiEvent, then the tooltip that loads at the mouse will show the file name.
Is this proper behavior? Because it seems backwards & slow to me.
Try it out:
| Code: | #SingleInstance,Force
OnExit,GuiClose
Gui,Add,ListView,AltSubmit gLV,TEST|TEST
Loop,%A_WinDir%\*.*
{
If A_Index >10
Break
LV_Add("",A_LoopFileName,"o hai")
}
Gui, Show
Return
LV:
Critical
ToolTip, %A_GuiEvent%,0,0,2
If (A_GuiEvent="I")
{
LV_GetText(name,A_EventInfo,1)
ToolTip, %name%
SetTimer, RemTT,On
}
Return
RemTT:
SetTimer, RemTT,Off
Sleep, 1000
ToolTip,
Return
GuiClose:
ExitApp |
|
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 337 Location: Texas, USA
|
Posted: Wed Jul 23, 2008 1:34 pm Post subject: |
|
|
This information is from observation only. I did not check the source code or Microsoft to verify.
When clicking a ListView item that is already selected, AutoHotkey or the OS (probably the OS) waits for another click (i.e. double-click) before deciding that the initial click was the only click. Only after this determination can the program/OS send the notifications that you're looking for.
To verify this, go to the Control Panel and change the double-click speed of your mouse to as fast as it can go. After making this change, try your test again. Your ToolTip should be more responsive when you click on an item that is already selected.
Them be my thoughts... |
|
| Back to top |
|
 |
adamrgolf
Joined: 28 Dec 2006 Posts: 362
|
Posted: Thu Jul 24, 2008 6:20 am Post subject: |
|
|
True, this does make it respond faster, but its still not instant.
My question i guess is, why when selecting a new row are the guievents recieved as I then Normal, but when clicking an already highlighted row is it recieved Normal (pause) then I... ? Shouldn't a newly selected row also wait to see if you are going to double click? |
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 337 Location: Texas, USA
|
Posted: Thu Jul 24, 2008 10:05 am Post subject: |
|
|
| adamrgolf wrote: | | Shouldn't a newly selected row also wait to see if you are going to double click? |
It does. But because you clicked on an unselected row, codes for a single click are sent first. If the single-click becomes a double-click, codes for a double-click are sent.
The ToolTip in the code is good but to see what is actually happening and in what order, put an "outputdebug A_GuiEvent=%A_GuiEvent%" statement in the code right after the Critical statement. Open a debugger and try the test again. When you single-click on an unselected row, you'll see all of the codes you're expecting. But when you double-click on an unselected row, you'll see that all of the codes for a single-click are sent first and then codes for a double-click follow.
I hope this helps. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|