Using the same keyboard shortcut in different areas of IDE for different actions does not work

已回答

In Debug Console there is a toolbar button "Clear All" with no keyboard shortcut by default.

I assigned "Delete" key as a keyboard shortcut for this action in Settings | Keymap in section Other | Clear All.

When assigning this shortcut I got warning saying "Already assigned to: Delete in Main menu | Edit".

After assigning this shortcut it does not work in Debug Console.

As Debug Console is read only view of text (there is no text editing possible there) I thought there would be no conflict with already existing shortcut for "Main menu | Edit".

Why doesn't this work and what's the reason to have simple edit action like deleting a letter in "Main menu | Edit" at all?

I'm using PyCharm but I'm posting this here as I guess it's a feature of IDEA platform and not specific to PyCharm.

 

 

0

I was hoping for some explanation, context, anything…

That's why I posted here first instead of submitting request.

0

> Why doesn't this work and what's the reason to have simple edit action like deleting a letter in "Main menu | Edit" at all

The action in Edit menu is not for deleting text in editor, it's for a 'general' delete operation which can work in many places, e.g. deleting rows/columns in a database view. What you wanted to achieve didn't work due to another 'delete' action, local to console view, not visible in keymap settings. Strictly speaking, console view is not a read-only view - to support providing input to running programs (via stdin) it allows to type text and to edit it, so it has its own 'delete' action for deleting of user-input characters. That action took precedence and didn't let 'Clear All' trigger on Delete press. Theoretically it can be changed so that it's 'muted' while there are no user-input characters, but it seems there can be a problem with it - if one tries to delete user input and presses one more Delete accidentally, it will delete all program output. I'd recommend you just assign a different shortcut to 'Clear All' action, not conflicting with text editing.

0

Dmitry,

Thank you very much for very detailed description of what's going on. This is exactly what I was hoping for. It's unfortunate this local 'delete' action is not visible in keymap settings.

0

One more thing. It looks like making Debug tool window (which I have opened in separate window) active "manually" (i.e. not from within IDE using keyboard shortcut (alt+5) but by clicking on the title bar) makes the shortcut for Clear All (probably other shortcuts as well) not working until after I click on some tab.

Can you confirm? It looks to me like a bug, is it?

0

Might be some focus-related issue (which I cannot reproduce myself). It's better to raise a YouTrack ticket for it with the details.

0

Hmm, even Esc does not work in "windowed" Debug tool to return to editor…

 

 

0

请先登录再写评论。