Keypress Listener
已回答
Hello, I am writing a little plugin in which I want to listen if the user types anything in an editor and then do something based on the keystrokes.
I don't need to know which keys exactly are pressed just whether keys are pressed at all or not. Is there a listener that I can use in order to listen to the keystrokes done in the IDE?
Best regards
Daniel
请先登录再写评论。
Please explain your use case in more detail. What keystrokes? single ones? or actual, "real" input? in any context? etc.
Hi Thanks for response.
I want to track if any key was pressed each time a key is pressed. So say if a programmer within his project types "aaaa" I want four events each stating (at least) that a key was pressed (and preferably ) which key was pressed. I hope this clarifies
https://plugins.jetbrains.com/docs/intellij/editor-events.html#creating-a-custom-typedactionhandler
Thank you
Do you by any chance also know how I can add functionality to the execute method without overwriting the already existing functionality. My problem is that when I can't get hold of the default 'typedActionHandler' to use it's execute method after I did what i wanted to do with the 'typedActionHandler'.
To clarify the scenario is:
1) the programmer presses any key
2) my custom typedActionHandler gets active and calls one of my services to do stuff
3) the custom typedActionHandler calls the default typedActionHandler to proceed with the key press of the programmer
How do i get the default typedActionHandler?
Found a working solution:
in plugin.xml:
in class file:
Check it out https://plugins.jetbrains.com/docs/intellij/editor-events.html#creating-a-custom-typedactionhandler slope game