How to capture TAB key press

Answered

How to capture the TAB key press in the editor? I tried KeyListener but it seems it can only capture chars or shifts.

0
1 comment

Tab key presses, as well as other shortcuts which has bound actions, are not dispatched via standard Swing mechanism, they are processed by action subsystem. You can still intercept the event if you need using `IdeEventQueue.addDispatcher` or `IdeEventQueue.addPostprocessor`, but if you want just to amend Tab functionality in editor it's better to implement your own `EditorActionHandler` for Tab action - see https://intellij-support.jetbrains.com/hc/en-us/community/posts/206105589-Customize-Tab-Insertion-Behavior for details.

0

Please sign in to leave a comment.