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.04k stars 257 forks source link

Is there a way to detect when ctrl is pressed? #142

Closed Eliasyoussef47 closed 3 years ago

Eliasyoussef47 commented 3 years ago

I want to globaly detect when ctrl is pressed (just the Control key. No other combinations.) And the example in the README, keycomb and #41 don't work.

Is this possible?

Eliasyoussef47 commented 3 years ago

I figured it out. You can detect ctrl with IKeyboardEvents.KeyDown and IKeyboardEvents.KeyUp but not IKeyboardEvents.KeyPress. This is in IKeyboardEvents.cs:

The KeyPress event is not raised by non-character keys; however, the non-character keys do raise the KeyDown and KeyUp events.

anastasiosskg commented 7 months ago

Is there any example code how to detect left -> ALT CTRL SHIFT?