Click here to Skip to main content
16,020,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I am writing a program to display hotkeys being used for video tutorials.

I need to detect an I-Beam cursor globally or a global cursor change. This is for the purpose of detecting if the user is entering some text or about to enter some text, in which case it is not a hotkey and as such don't show whats being typed.

Is it possible to do this in a C# WPF application ? - I have googled it to death, and nothing really tells me how to do this.

Any Help would be appreciated

Rob

What I have tried:

[DllImport("user32.dll")]
public static extern bool GetCursorInfo(out CursorInfo info);
Posted
Comments
Dave Kreskowiak 5-Apr-23 22:43pm    
I don't even think Windows support such a notification. I've never heard of anything like that.
Robert Andersen 2022 5-Apr-23 22:53pm    
OK - that sucks, but thanks mate!
0x01AA 6-Apr-23 7:05am    
Can be I don't understand your request. But for me it looks like you need something like this: Preview events - WPF .NET | Microsoft Learn[^]
Robert Andersen 2022 6-Apr-23 11:16am    
Thanks - tunneling is probably above my pay grade
What I am ultimately trying to do is detect the user is about to enter text, ie: renam something, enter numeric sizes etc. If the user is about to do any of these don't show keyboard hotkeys on tutorial screen. The only two ways I can think off to do this, is to detect an active caret, or see if the cursor changes to the I-Beam.

Rob
0x01AA 6-Apr-23 11:21am    
You are welcome.
'tunneling is probably above my pay grade': I don't think so, give it a try ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900