How can I listen for keyboard events on file with specified extension in project tree?
Answered
I have idea to open external program by pressing F3 on file with my custom extension. How can I listen for keyboard events on file with specified extension in project tree? Thanks.
Please sign in to leave a comment.
Register AnAction implementation and add it to group ProjectViewPopupMenu, then obtain currently selected file via com.intellij.openapi.actionSystem.CommonDataKeys#VIRTUAL_FILE.
Additionally, you can restrict visibility/availability of your action by checking ActionPlaces.PROJECT_VIEW_POPUP in update() method.