EditorTextField: getting control keystrokes like Esc, etc

Answered

I'm trying to display a panel with EditorText field and I want to remove it upon receiving a ESC key. I tried to use the TypedActionHandler but it looks like that doesn't intercept control characters. How would I go about doing this?

 

Thank you!

 

0
2 comments

You'll need either to create a global handler for EditorEscape action (see e.g. how com.intellij.codeInsight.hint.EscapeHandler is implemented and registered), or create your own AnAction class and register it for the specific component using AnAction.registerCustomShortcutSet.

0
Avatar
Permanently deleted user

Thanks. I have another question: Is it possible to also intercept the focus lost event? I'm using the 

TextFieldWithAutoCompletion object which is derived from EditorTextField. I want to know when the user clicks the mouse on a toolbar or on the editor
taking focus away from this custom panel component that I'm displaying.


0

Please sign in to leave a comment.