Sign in to follow this  
Followers 0
jonny1234

ListView KeyUp Event

9 posts in this topic

Hi,

For a ListView control, it appears as though there is a LVN_KEYDOWN notification for KeyDown, but nothing for KeyUp (such as LVN_KEYUP).

Please can you tell me if there is any way to catch a KeyUp event for a ListView control.

I would like to determine when the user has finished keyboard navigation of the ListView, then run some code a specified amount of time later. So I would like to start a timer on the KeyUp event, then execute some code after the timer interval has elapsed, or else reset the timer if the user starts navigating the ListView again before the interval has elapsed. I don't want to run any of my own code while the user is navigating the ListView, only once they have stopped (say 200ms after they have stopped), in order to keep things running smoothly while they are navigating.

Any suggestions would be most welcome.

Regards,

Jonny

Share this post


Link to post
Share on other sites



Maybe you could use $GUI_EVENT_PRIMARYUP to find when the mouse button is released, and then check if the mouse was over the listview.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Thanks for your replies, but the application needs to be controlled by using the keyboard only, which is why I am asking about a KeyUp event and not a MouseUp event.

Regards,

Jonny

Share this post


Link to post
Share on other sites

its an example of how to use GUIRegisterMsg which if you look at it in the helpfile shows its possibilities

Share this post


Link to post
Share on other sites

its an example of how to use GUIRegisterMsg which if you look at it in the helpfile shows its possibilities

Here's the list of Notifications for future reference

http://msdn.microsoft.com/library/shared/d...hellcc1039_.xml


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Thanks for the notifications list.

It reinforces my belief that while you can do just about anything with the ListView control, it's not possible to catch a KeyUp event in it.

Regards,

Jonny

P.S. Thanks for GuiListView.au3, gafrost. I am finding it very useful.

Share this post


Link to post
Share on other sites
;) could of swore i saw a LVN_KEYUP, why is the Keyup so important maybe there could be a work around if you havent already found one

Share this post


Link to post
Share on other sites

;) could of swore i saw a LVN_KEYUP, why is the Keyup so important maybe there could be a work around if you havent already found one

As an example of why I would like to detect a KeyUp event, suppose the user presses the down arrow key on the ListView. This causes the next item in the list to be selected. Any time a new ListView item is selected, it appears that (at least) 4 events fire:

LVN_ITEMCHANGING, LVN_ITEMCHANGED (for the the previous item that was selected)

LVN_ITEMCHANGING, LVN_ITEMCHANGED (for the the new item that is selected)

In the LVN_ITEMCHANGED event, I have some code to display some text in an edit control, relating to the current ListView selection. If the user holds down the down arrow key to scroll down the ListView, lots of events build up everything slows right down.

So, rather than have the display code in the LVN_ITEMCHANGED event, I would like to have it in a KeyUp event, so that text is displayed in the edit control only when the user has stopped scrolling through the ListView.

It would be great if there was a workaround, and I would appreciate any suggestions.

Regards,

Jonny

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