gmamaladze / globalmousekeyhook

This library allows you to tap keyboard and mouse, detect and record their activity even when an application is inactive and runs in background.
MIT License
1.05k stars 257 forks source link

Use unfriendly on WPF #104

Open charlesmz opened 5 years ago

charlesmz commented 5 years ago

In WPF, the e.handled=true in the KeyPress event is not valid, and the TextBox event will still trigger

thavious commented 5 years ago

in the KeyListener.cs file, in the Callback function, when he calls InvokeKeyPress(pressEventArg), add a line afterwards e.DownUp.Handled = e.DownUp.Handled || presssEventArg.Handled; That should tell the hook to not pass the key onward on the chain.