Custom Text Editor Key Shortcuts

Answered

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

0
2 comments

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 https://plugins.jetbrains.com/docs/intellij/plugin-user-experience.html 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.

0

Hi Karol,

perfect, thanks, that is exactly what I needed.

 

Milo

0

Please sign in to leave a comment.