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
请先登录再写评论。
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 whenPlatformCoreDataKeys.FILE_EDITOR
from data context is your editor.Hi Karol,
perfect, thanks, that is exactly what I needed.
Milo