Ticket #3725 (new enhancement) — at Version 2

Opened 7 years ago

Last modified 7 years ago

Don't limit hotkeys in user menu to simple letters only

Reported by: mooffie Owned by:
Priority: major Milestone: Future Releases
Component: mc-core Version: master
Keywords: Cc: egmont
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description (last modified by mooffie) (diff)

Currently, menu labels in the user menu have their 1st character interpreted as hotkeys:

@      Do something on the current file
0      Edit a bug report and send it to root
2      Call the info hypertext browser
3      Compress the current subdirectory (tar.gz)
d      Delete file if a copy exists in the other directory.
...
c      Copy to clipboard the current dir's path
C      Copy to clipboard the current file's path
D      Copy to clipboard the current file itself
X      Cut to clipboard the current file itself
V      Paste files from clipboard
Q      Copy to clipboard the first URL mentioned in the file.

This is quite limiting when there are many menu items. The attached patch lets the user specify any hotkey. Example (only the last four lines have changed):

@      Do something on the current file
0      Edit a bug report and send it to root
2      Call the info hypertext browser
3      Compress the current subdirectory (tar.gz)
d      Delete file if a copy exists in the other directory.
...
c      Copy to clipboard the current dir's path
C      Copy to clipboard the current file's path
ctrl-c Copy to clipboard the current file itself
ctrl-x Cut to clipboard the current file itself
ctrl-v Paste files from clipboard
f2     Copy to clipboard the first URL mentioned in the file.

(only the last four lines have changed: see "ctrl-c" and "f2".)

Note: because of the way hotkeys work in MC (see dlg_try_hotkey()), the hotkeys "alt-x" and "alt-X" are equivalent to pressing just "x". So alt keys shouldn't be used as hotkeys. (dlg_try_hotkey() could be modified to work around this but that's a matter for a separate ticket.)

Change History

comment:1 Changed 7 years ago by mooffie

Comment:

A different approach to having the hotkey as the 1st word is to embed it in the label using, for example, square brackets:

Copy to clipboard the current file itself [ctrl-c]

The advantage in this syntax is that we could then extract such hotkeys from strings in other places, like in the "Directory hotlist" dialog (see screenshot; albeit here (mc2) it's implemented in a very different way).

Changed 7 years ago by mooffie

comment:2 Changed 7 years ago by mooffie

  • Description modified (diff)
Note: See TracTickets for help on using tickets.