halirutan/IntelliJ-Key-Promoter

Not existing shortcuts

Closed this issue ยท 16 comments

It's showing not existing shortcuts. For example:

shortcut

Are you sure? ๐Ÿ˜„

Try the following. Start anywhere inside your code with the focus on the editor. Press Alt+1 for opening/switching to the project tool-window. I assume you are on any java class file (or some other file). Press the Context Menu key on your keyboard. On my Cherry Mechanical Keyboard it is this key

cmxb6_03

Now the context menu opens that you would get when using the mouse and righ-click.

And now see what happens when you press Alt+H for history.

When context menu opened (has been pressed context button) mnemonics available without Alt

I got this popup by pressing Context->G->H or Context->H->H or any mnemonic from context menu.
I think it's not correct behavior.

It is correct when I have pressed for example Context->U (find usages) and got popup with Alt+F7

Yes, you are correct. The popup appears even when you press the keys. I cannot promise if I can fix it, as I'm relying on IDEA's framework that provides me with information about the action that was used.

Oh, and your keyboard is awesome. ๐Ÿ˜ƒ

@nanson Bad news. Pressing Context->G->H creates an event that is an instance of MouseEvent. At this point, I don't see any way to distinguish if the user used the mouse or the keyboard. The only solution I can suggest is that I create another settings entry that lets you disable "EditorPopup" actions completely.

These 3 lines of code are the source of the confusion. The beforeActionPerformed method is called by IDEA as soon as an action was called. Here, it happens that the context menu actions are confusingly MouseEvents. The event.place() gives me an idea about where the action is originated. So I guess an easy temporary fix is to be able to turn off all suggestions from editor-popups. What do you say?

Oh, and your keyboard is awesome. ๐Ÿ˜ƒ

Yeah, I know. It's not perfect, and I searched for a long time, but it is quite good. I had a Razor Black Widow before where I liked the loud click of the mx blue keys. Unfortunately, the Cherry MX 6.0 Board has no option for MX Blue keys. Another thing is that the black paint is by far not as durable as with other keyboards. Cherry should know that someone who buys such a keyboard spends a lot of time in front of the computer. On the keys that are used the most (like the small orientation bumps on the F and J key), you can already see the red light shining through. Very disappointing.

Besides this, it is very nice. Especially the aluminium body and the magnetic palm-rest. And of course the precision of the keys is awesome.

(And this is how you turn an issue into a product review)

Plugin Force Shortcuts determines whether was mouse clicked or key pressed. Is this can be useful?

@nanson Yes, he uses (like the original KeyPromoter) the AWTEvents. I have built this in and it seems to work. The thing is that I'm questioning the whole usefulness of this tip

tip

The biggest hindrance is that the user needs to find the key for opening the context menu. Then, as you already pointed out, there is no need for pressing Alt+H. You can simply use H and you have to use it twice, since you first need to access the submenu "Local History".

That being said, when you use Context Menu -> Local History -> Put Label with the mouse, you see the tooltip Alt+L which doesn't work by itself. You need to access the context menu and the Local History menu first.

I'm getting the information of the shortcuts from IDEA itself, so there is nothing I can do to validate them. Maybe one solution is to give a general tip for the context menu. Something like

You can access the context menu by pressing the Menu key and then navigating by using the underlined mnemonics.

It's could help.
But we get useful tips if shortcut exists for selected context menu item (like "Find Usages")

@nanson I believe I fixed the issue successfully.

  1. If you open the context menu with the appropriate menu key, then no popup will appear
  2. If you make a right-click with the mouse and select an entry then
    a. it will show the shortcut if there exists a shortcut
    b. it will show the "do you want to create a shortcut" depending on your Key Promoter X settings

Can you download the new version 5.7 here and install it manually? If everything works, I will push it to the Jetbrains repostitory.

In case 2.b tip not always shown.

Also, if I select Context menu->Local History->Show History from editor I got tip "do you want to create a shortcut", and if I do the same from Project View tool window - I got tip with Alt+H

Ahh, as it turns out the place is different if you have a popup in the project-view or the structure-view. I have tried to unified this by catching all .*Popup actions. Please try

version 5.7.1

It works only from the editor, and not every time (in case 2b). ๐Ÿ˜ข
Also, need to rename settings from "Editor Popup Menu" to "Context Menu"

@nanson I tested it on MacOS and Linux and for me it works for all toolwindows like Project View, Structure View, etc.. You know that you have to adjust how often you want to get a tip for do you want to create a shortcut, yes? It is intentional that this doesn't always show up.

Under Settings -> Tools -> Key Promoter X you find

screen shot 2017-07-26 at 10 38 41

"Number of invocations before suggest create shortcut" which means here, only on every 2nd click you will get the suggestion.

Can you exactly tell, what you did and what doesn't work?

You right. I forgot about this setting and confused.
It works great!!! Thank you!

Only need to rename the setting from "Editor Popup Menu" to "Context Menu", for example.

Only need to rename the setting from "Editor Popup Menu" to "Context Menu", for example.

Yes, I saw that I forgot to rename this. I will do it tonight and push the new version to jetbrains. Thanks for helping to solve this issue!

Thank you for great plugin )))