TolikPylypchuk / SharpHook

SharpHook provides a cross-platform global keyboard and mouse hook, event simulation, and text entry simulation for .NET
https://sharphook.tolik.io
MIT License
347 stars 32 forks source link

KeyChar is not defined #69

Closed magals closed 1 year ago

magals commented 1 year ago

On all keys the character type '?' is always output. RawEvent.Keyboard.RawKeyChar = 65535

image

TolikPylypchuk commented 1 year ago

Hi! Thanks for asking! KeyChar and RawKeyChar are not available in the KeyPressed event. You need to subscribe to the KeyTyped event instead - then you'll be able to use KeyChar. Note that not all key presses lead to KeyTyped events. For example, if you press Ctrl it will not lead to a KeyTyped event.