Npp Shortcut mapper: 2 different sub-dialogs or forms
-
Are there specific use cases for the Shortcut mapper to have 2 sub and slightly different sub-dialogs as shown in the following screenshots?
Available for Scintilla commands tab only
Available for all other tabs
Anyway, I was in the act of customizing some Npp keyboard shortcuts using the Shortcut mapper and I just realized of the presence of 2 slighltly different sub-dialogs (or forms) I didn’t know of yet because I had customized commands in all tabs but the last one for Scintilla’s.
Situation:
- 2 sub dialog? Wouldn’t be better none sub-dialog but doing the mapping in the Shortcut mapper dialog it self?
- Using the sub-dialog Shortcut is tedous since for each mapping action there are too many single actions to do
-> Open the main dialog
-> Find the command to map a shortcut to
-> Open the sub-dialog
-> Search for a shortcut that doesn’t overlap with an existing one
-> Confirming
-> Repeat from 2nd step - The drop-down menu
containing the list of possible normal and special chars/keys seems to have a limited list of them and in some phisycal keyboard layouts do not contain some of the chars in the drop-down, and some others: for example the tilde symbol and some others cannot be used since to use them it is necessary to get them by typing the relative ASCII or Unicode char-code number: and that makes problematic to use a shortcut that contains those chars. This, potentially, limits the number of possible combinations.
Other keyboard layouts there are other chars that could be used easily because are accessible but they are not present in the mentioned drop-down list.
I suppose some of the above aspects are due to internationalization/localization needs but I am not sure
To solve the above issues IMHO would be interesting the evaluation of the following solutions.:
- completely remove the sub-dialog labeled/titled “Shortcut”
- in the main dialog labeled/titled “Shortcut mapper” modifying the column labeled “Shortcut” to have directly editable fields (like in a Spreadsheet table software), since now all columns in it are read-only: the user can type the whished keyboard shortcut directly in such column in the Shortcut mapper dialog:
- the user that needs to map a new shortcut to a command/function or modifying an existing one, should have just to:
- Click on the relative field of the “Shortcut” column (That will be editable similarly to an Excel table as above proposed)
- Press the shortcut combination directly on the keyboard (no drop-down selection and no check-boxes for Ctrl Alt Shift needed anymore)
- The field will get the keystrokes and will show them to the user for feedback, and also the dialog will show collisions of already mapped shortcut: if a collision with an already mapped shortcut is detected, the dialog will feedback the user the way it already does now with a red background and with a feedback message and will also, alternatively:
-> Automatically clear the Shortcut field, after a few seconds to let the user the time to read the feedback message
-> Automatically select the entered keystrokes (basically the whole text field value) so that the user will be able to just type another one to replace it
-> Give the user a feedback message and activating a disabled or showing an hidden button to allow the user to assign the elsewhere already mapped keystrokes to the currently command that is mapping, removing the shortcut keystrokes from the other command they where previously assigned to
The 3 above behaviors could be chosen by the user by checking one of 3 different option/bullet boxes to implement in the same dialog, so the user can change the behavior at any moment depending on the contingent needs (but I think that the last one is the best way to go)IMHO the above improvements will grant
- a more Ergonomic and simplified and coherent Npp GUI
- a better user experience
- no more hidden red lines once the user saves the final configuration that the user has most of the time to search by hands scrolling the whole list up and down hunting for them
- the shortcuts mapping will also reflect at 100% the actual keys on the real user keyboard than those currently present in the drop-down combo-box that I am afraid lacks of some chars that could be used in some occasions to map a shortcut to a command (for ex. the | char and some others that are only present in some languages) that with the above suggested upgrade would be also available to be easily mapped.So, please Evaluate this proposal to see if it is worthy to be sent to the Npp developers team on github.
Thank you all for reading.
-
@wonkawilly Notepad++ only allows now shortcut for Notepad++ actions. It allows more than one shortcut for Scintilla actions. If you edit the shortcuts.xml file manually you will discover that attempting to rig things up so that two shortcuts point at the same Notepad++ will not work. You will get the shortcut that appears first in shortcuts.xml and the other one is ignored.
I have never dug into the Notepad++ code to discover why this restriction exists. One reason I can guess at is that when drop down menus are displayed they also show the shortcut, if any that can be used for that action. If more than one shortcut was allowed for an action then that code at minimum would need to be cleaned up.
I agree with you though that it’s confusing that the Scintilla actions in the shortcut mapper’s GUI have a slightly different dialog box and behavior.
My own focus for a project such as the one you are proposing would be to first fully understand why there is a one-to-one restriction for shortcuts to the Notepad++ actions. Once I knew that, then I suspect I could suggest constructive improvements.
-
@wonkawilly said in Npp Shortcut mapper: 2 different sub-dialogs or forms:
special chars/keys seems to have a limited list of them and in some phisycal keyboard layouts do not contain some of the chars in the drop-down, and some others: for example the tilde symbol and some others cannot be used since to use them it is necessary to get them by typing the relative ASCII or Unicode char-code number
Since you don’t seem to be aware of this, we have a FAQ which explains what each of those keycodes maps to on different (international) keyboards. For example, on a standard French keyboard, the
~
shortcut is accessed using theù %
key, because that’s theVK_OEM_3
.In @guy038’s section of that FAQ, it lists the scancode, the US keyboard equivalent, and the French keyboard equivalent. Other sections of the FAQ include the standard German and Portuguese mappings, and my post in that FAQ links to a website that allows you to figure out which keys on your keyboard map to which virtual keys – so if you have a keyboard not listed there, feel free to make a table like the German or Portuguese tables shown, and I can add it to the FAQ so that other users of your keyboard layout will have access.
-
@mkupper said in Npp Shortcut mapper: 2 different sub-dialogs or forms:
My own focus for a project such as the one you are proposing would be to first fully understand why there is a one-to-one restriction for shortcuts to the Notepad++ actions.
My working assumption has always been that the developer added the multi-shortcut feature for Scintilla commands because it was required so that it could use DOS-style (
Ctrl+INS
/Shift+DEL
/Shift+INS
) and Windows-style (Ctrl+C
/Ctrl+X
/Ctrl+V
) shortcuts for the same commands, but he never saw a good reason for the extra complication of having multiple shortcuts on any Notepad++-specific actions. (With the magic-copy logic now existing, those three special exceptions have been given two entries in the Main shortcut tab, rather than being part of the Scintilla tab, which I find somewhat amusing, and at least one user has complained about.)There is an existing issue from 2018, requesting multiple shortcuts allowable for any action – but there was never any reply by the developer (yea or nay), so it sounds like it’s “uninteresting” to him, so he leaves it in the limbo state – in theory, someone interested could try to make a PR to that request, but he would be within his rights to reject it, and thus the contributor would have wasted his time; most of the regular contributors don’t bother implementing old requests like that until and unless they are certain that the developer would actually approve it.
Evaluate this proposal to see if it is worthy to be sent to the Npp developers team on github
Regarding your “spiffy new streamlined shortcut mapper”, I have a feeling that any PR submitted for such a request would be rejected out-of-hand as being too risky – so I cannot imagine any of the regular contributors trying to impliment it, and I would be very surprised if the developer implemented it himself if a random user (or any of us regulars) suggested it, even if a hypothetical issue did get dozens of "me too"s and upvotes.
As such, and because while it’s not the best possible interface, it works sufficiently for my needs and doesn’t annoy me, so I’m not interested enough to create an issue about it.