Jump to content

ListView KeyUp Event


jonny1234
 Share

Recommended Posts

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

Link to comment
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.
Link to comment
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.

 

Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

  • 11 years later...
  • Moderators

kklee69,

You do realise that the post above yours dates from close to 12 years ago - and that the poster has nor been on the forum for over 4 years? What makes you think that he will reply?

Please do not necro-post like this again.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

8 hours ago, Melba23 said:

kklee69,

You do realise that the post above yours dates from close to 12 years ago - and that the poster has nor been on the forum for over 4 years? What makes you think that he will reply?

Please do not necro-post like this again.

M23

SORRY !!  Next time I will pay attention

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...