Custom Text Editor Key Shortcuts


Hi, I have a Pycharm plugin with custom editor implementation. How do I block the default Key shortcuts, for example F1-F8, and have it call my callbacks instead? Also, I'd need to detect CTRL Up / Down. I tried TypedHandlerDelegate, but that only detects keystrokes producing some characters.

Thx, Milo

Comment actions Permalink

Hi Milo,

Please replace shortcuts carefully to not break IDE UX. It is important that users get the expected behavior for shortcuts they know. See for the full context.

I would try to register your actions with the same shortcuts you want to override and implement com.intellij.openapi.actionSystem.ActionPromoter which promotes your actions when PlatformCoreDataKeys.FILE_EDITOR from data context is your editor.

Comment actions Permalink

Hi Karol,

perfect, thanks, that is exactly what I needed.




Please sign in to leave a comment.