Jump to content

Recommended Posts

Posted

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

Posted

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.
Posted

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

Posted

  thatsgreat2345 said:

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.

 

Posted

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.

Posted

  thatsgreat2345 said:

;) 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

  • 11 years later...
  • Moderators
Posted

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:

  Reveal hidden contents

 

Posted
  On 3/24/2018 at 10:05 PM, 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

Expand  

SORRY !!  Next time I will pay attention

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
  • Recently Browsing   0 members

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