How to detect ESC keypressed ?
-
Hi,
Do you know if and how I can be notified when ESC key is pressed ?
I tried
SCN_CHARADDED,SCN_MODIFIED,SCN_KEY+ some other scintilla notification codes, but none of them is invoked when ESC is pressed. I couldn’t find anyNPPN_*notification which looks useful for that too.Any suggestion ?
Thanks -
to quote from scintilla
SCN_KEY
Reports all keys pressed but not consumed by Scintilla. Used on GTK because of some problems with keyboard focus and is not sent by the Windows version.At the moment I only see the way to either register a low level keyboard hook or hooking npps message queue in general.
-
In the BetterMultiSelection plugin I’ve used SetWindowsHookEx() to hook the keyboard and catch the escape key (along with other keys) before they are sent to Notepad++.
See https://github.com/dail8859/BetterMultiSelection/blob/master/src/Main.cpp
-
Thanks you both for your help.
I followed your suggestion (low level keyboard hook) and I can now handle ESC key pressed.
Best Regards
-
E Ekopalypse referenced this topic on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login