Let's talk about customizable keyboard shortcuts

Features wanted...
admin
Site Admin
Posts: 64822
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Let's talk about customizable keyboard shortcuts

Post by admin »

Okay, this will be the next big thing! The demand for it has become massive and unmistakable recently. Folks started practically begging me on their knees for CKS. And, well, I have a soft spot for users in need. Plus it's an interesting task to add this to an app about 8 years too late :wink:

I'm not talking merely about CKS for the catalog (those will come, too) -- no, I'm talking about the real & radical thing: CKS for everything!

What's everything? Some keyboard usage should certainly remain untouched, like arrow keys, Del, Esc, PageUp etc. and should not be exploitable for other functions.
Also, things like Ctrl+C for Copy (probably already untouchable UN cultural heritage)... should these be negotiable? I don't think so.

Another question: what shortcuts are allowed? Single letters, too? E.g. "A"? Naah. I would say, at least one of CTRL, SHIFT, ALT should be present.

The current hard-coded shortcuts will remain to be the default, of course. I think I will save the keyboard shortcut layout in an extra INI file, ks.ini or so, so you can keep it independent of loading any other configuration INIs.

More thinking in public will follow. Any ideas are most welcome, of course!
zridling wrote:(1) What single feature do you miss most in XYplorer?
Customizable keyboard shortcuts, perhaps similar to the intuitive way programs like Emurasoft's EmEditor and EmFTP Pro, or the way NewsGator's FeedDemon does it, which also allows you to copy or print your shortcuts (hotkeys). An import/export or the ability to include this in the saved configuration would be great.
That's a very good start for me, thanks!

allen
Posts: 89
Joined: 10 Sep 2006 19:25
Location: Northern Maine

Post by allen »

An issue very near and dear to my heart :)

My favorite applications have adopted total keyboard mapping over the years, I'm starting to feel spoiled -- Opera, EditPad Pro and The Bat! come to mind immediately as the former two I use daily and have put a lot of time into custom mapping. Of all the applications, EditPad Pro seems to have the best balance (in my opinion) of breadth AND customizability. While in Opera you can do nearly anything with the keyboard, its system isn't immediately as easily accessible by anyone short of power users. One could, of course, make the argument that no one who isn't a true power user bothers with such things anyway, though . . . :)

Anyway, just as an example, I'll outline EditPad's means of customization as I think it deploys a lot of great ideas you could borrow from/build upon.

First of all, the whole thing is in its own settings dialog wherein where the toolbar, context menus and shortcuts are handled. Virtually every function/menu item in the application is listed here -- which can be added to or removed from various menus and context menus throughout the application. Most importantly, when you select any of these items you can see what (if any) its shortcut key is and assign a shortcut from there.

Of all that, to me the most important thing is the hierarchal presentation of all the menus so you can easily find what it is you're trying to add a shortcut to.

Another really cool feature that a few applications I use deploy is 2 step shortcuts (aka word start style). For this, you can enter a two-step shortcut. For example, you could have ctrl+c, c to topy a file; ctrl+c, ctrl+c to copy a file to, etc. -- that way you can cluster several keystrokes under another allowing not only for potentially far more keystrokes, but some easier to remember combinations. That's a bad example, as it's unlikely you can/should modify ctrl+c, but anyway. Maybe ctrl+t, 1; ctrl+t,2, ctrl+t,3 etc. to change tabs, but only using one shortcut out of the primary list (ctrl+t)

as for single alpha-numeric shortcuts, I know I would never use them as I often find files in a folder by typing out the first few letters of their name. Shortcuts would totally throw that off :) Requiring one of ctrl, alt or shift seems fair enough -- any chance of throwing the win key in there as well?

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Post by j_c_hallgren »

What I would see as critical is some way to verify that a desired key combo is not already in use for another shortcut :!:
And what the default combo is...sort of a three column list, with first being the function, second the default/std, and third the custom value, if allowed...
Having a way to print this in a (possible two-up?) listing would be needed..
Maybe a way to sort this list by each of the three columns? To help determine what keys might be usable or available, this could be very handy.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

admin
Site Admin
Posts: 64822
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

Thanks so far for your ideas, folks!

Just some quick replies for now:

- no, winkey is not possible
- 2 step shortcuts ... hmm, that's a cool idea for later
- of course, if a combo is already in use, you'll get a warning

I think, the easy answer to "Which commands can have CKS?" is: everything that's in the menu of the main form, right? With a few exceptions: some will remain hard-coded (Ctrl+C, Alt-Back, Del...) and maybe some will be added (like Nuke for which there's only a TB button :wink: ).

Gandolf

Post by Gandolf »

admin wrote:2 step shortcuts ... hmm, that's a cool idea for later
Yes, for those old enough to remember WordStar. Groups of similar commands had a common first letter and then a second letter. For example, sorting by column could be Ctrl+S followed by N, E, S etc... Not a very good example but gives the idea.

zridling
Posts: 140
Joined: 29 Jul 2006 06:12
Location: Chicago, US
Contact:

Post by zridling »

Don, I think you're on the right track — start with what XYplorer provides right now and let the user redefine as they see fit. As a new user, most all of XYplorer's current keyboard shortcuts "make sense" to me — F3, F5, F7, CTRL+SHIFT+H, CTRL+SHIFT+J, CTRL+SHIFT+T, and many others.

The lure of customizable keyboard shortcuts is that it returns power to the user in the form of efficiency. Many of us keyboard nuts have a foundation program, whether it be their favorite email app, word processor shortcuts, or the ones they find in their text editor, browser, what have you, and then they try to mimic many of those throughout other programs they use. By doing this, of course, it reduces one's memory load, and makes for an easier transition to XYplorer. Suppose I'm migrating from a long-used file manager like Total Commander, and I find XYplorer allows customizable keyboard shortcuts? That removes one major obstacle for moving and registering XYplorer. More importantly, it allows users to tweak a few of the keyboard shortcuts they use most often throughout their day. The less time spent touching the mouse, the more work I get done is true for any program.

That said,
(1) Will the number keys — 1, 2, 3... — on both the keyboard and keypad be in play? and,
(2) If you're going to hard code the fundamental keys, such as CTRL+C, CTRL+X, ALT+F4, and so on, please allow only those and not duplicates of those to be hard-coded.


I'm not sure if XYplorer has duplicate keyboard shortcuts, but some text editors do have duplicates for most of the fundamental functions for some odd reason — using CTRL+C and SHIFT+F6 for copy or CTRL+Tab and CTRL+F6 for switching panes/windows, etc.
- Zaine Ridling, The Great Software blog

admin
Site Admin
Posts: 64822
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

Okay. Finally I have started implementing CKS! :D

For this, I have to take apart larger chunks of code, throw them into a blender, and re-bake them to fresh new cookies.

Means to say: no updates here for some days!

Creat
Posts: 234
Joined: 22 Sep 2005 18:27

Post by Creat »

allen already mentioned Opera. I'd like to point you to it's keyboard shortcut engine for inspiration, since it's the most powerful one I know (and one I got to love).

Basically, it offers different categories for different focus areas (global, browser window, mail editor, and so on) You define the shortcut targets not by selecting them from a (inevitably) chunky and long list, but you just type what you want and are presented with likely and close matches. Same with the actually used keys: just enter "ctrl b" or "b ctrl" to assign a command to that combination.
There's a search box at the top, you can type in free-form text like a shortcut you'd like to replace or remove, or a command name to see if it already has a mapping and so on.

I hope you just install Opera (if you don't have it already) to take a look, I personally love the way they handle CKS.

thanks,
Creat

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Post by lukescammell »

I haven't read through this discussion yet, so sorry if this has already been said (just count it as another vote if so). Why not make *EVERYTHING* customisable?

What's the issue with making things like CTRL+C customisable? It will be there by default, and you can always reset if you screw things up, so why not?
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

John Bee
Posts: 323
Joined: 01 May 2005 20:21
Location: Win10, Win11 @100%

Post by John Bee »

admin wrote:Okay. Finally I have started implementing CKS! :D
Does this mean we are going to get cks for menu items that have no cks at all, like RegExp Rename, Search and Replace? (I use these *all* the time). So much so that I am firing them with PowerPro shortcut key macros.

John

admin
Site Admin
Posts: 64822
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

Thanks for your input, folks. Short answers:

I'll check out Opera... not. :P I never liked Opera (the latest I know and dislike is ver 7). But thanks for the ideas you mentioned. Might become handy in a later stage.

Everything will be customizable, also Copy (default Ctrl+C) etc and RegExp Rename (default None). Exception: navigation keys which are global standard like Up, Down, Home, End, etc in Lists and so on.

The shortcut-to-function relation/mapping will be none/many-to-none/one, ie one shortcut can trigger none or one function, but one function can be triggered by any number of shortcuts. If you are crazy you can map all available shortcuts (which will be several hundred!) to one function! :lol:

BTW: I'm still not sure how to display a menu item caption that has more than one shortcut pointing to it. Just display one of the shortcuts? Or a comma separated list of all? (Could get a long one theoretically...)

John Bee
Posts: 323
Joined: 01 May 2005 20:21
Location: Win10, Win11 @100%

Post by John Bee »

admin wrote:BTW: I'm still not sure how to display a menu item caption that has more than one shortcut pointing to it.
Show the first one assigned to it with, say, a * after it to denote multiple cks to this function?

John

cajhin
Posts: 19
Joined: 29 Oct 2004 23:14

Post by cajhin »

my thoughts...

If I take the time to customize shortcuts, I'm going to be massively annoyed if they ever get overwritten (update, bug, whatever reason).
Therefore, I like the idea of having a dedicated ini file that I can backup.

Generally, I prefer INIs to GUIs.
ComboBox Kung-Fu is convenient and fool-proof, but it takes forever if you want to change more than a few keys.
(Media Player Classic has a nice GUI; check it out, you don't have to install anything).
I assume that only power users would want to customize the keyboard shortcuts of a 3rd party explorer, so some skill could be expected.

A problem in some apps: it is a pain in the *** to figure out the name of the function you want to assign a key to.
I'd really like a nicely documented list of all functions.
One possibility:
Have a default ini that lists all functions, but assigns no keys. When the user adds a key combination, the default action for this key is then overridden.

Example ini:
Refresh_Tree= //update the tree panel on the left
Rebuild_Tree= //I have no clue what this does
Refresh_File_List= //updates the file panel on the right
Refresh_All=F5 //edited: Explorer-like refresh
Refresh_All=Ctrl+R //edited: another key for the same function

In this example, all shortcuts would trigger the hardcoded default action, except F5 and Shift-R (the last two lines), which have been edited/added by the user.

To make configuration smoother, I would assign a key to the new function "reload key map". That way, I don't have to restart the app all the time to test my changes.

One more thing: if you add new functions to the list, I would add them at the end, NOT alphabetically. That way, it is easy to check what new functions a new version offers that didn't exist back then when I customized my ini.

BTW: I'd only want to see the first configured shortcut in the menus. Otherwise=big mess

admin
Site Admin
Posts: 64822
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

cajhin wrote:my thoughts...
Ini files are kind of slow compared to binary data files. My plan is to have both: a human readable and editable and backupable ks.ini and a ks.dat. Both contain identical information, but only the latter is used by the app at startup because it is much faster. If you want to edit your shortcuts via ks.ini or you want to use a ks.ini prepare by some other user, there is a button that will translate it to ks.dat.
On KS edits via GUI both ks.ini and ks.dat will be updated on "Apply" and the app interface and KS-functionality as well immediately without restart.
Logically, the app will run on edited shortcuts without ks.ini being present. If no ks.dat is present the app will use the internal defaults.
cajhin wrote:A problem in some apps: it is a pain in the *** to figure out the name of the function you want to assign a key to.
I'd really like a nicely documented list of all functions.
One possibility:
Have a default ini that lists all functions, but assigns no keys. When the user adds a key combination, the default action for this key is then overridden.

Example ini:
Refresh_Tree= //update the tree panel on the left
Rebuild_Tree= //I have no clue what this does
Refresh_File_List= //updates the file panel on the right
Refresh_All=F5 //edited: Explorer-like refresh
Refresh_All=Ctrl+R //edited: another key for the same function

In this example, all shortcuts would trigger the hardcoded default action, except F5 and Shift-R (the last two lines), which have been edited/added by the user.
Yep, naming the functions is bit of a challenge.
I'm currently starting the CKS project with all functions available through menus, which are quite a lot and luckily most of the important stuff is included here. An easy approach would be to use the menu structure for the naming convention, so e.g. "File_Info_PathName" should be sufficient to identify the command in menu "File|Info To Clipboard|Item Path/Name(s)". However, if in future for some reason I reorganize that menu, the name "File_Info_PathName" will be misleading.
This will be no problem for the ks.dat file which will contain ordinal numbers only, no strings attached. But ks.ini ... needs a thought or two...

BTW, ini files have no inline comments (as in ... //comment) AFAIK. Only ";" at line start works as a comment marker.
cajhin wrote:One more thing: if you add new functions to the list, I would add them at the end, NOT alphabetically. That way, it is easy to check what new functions a new version offers that didn't exist back then when I customized my ini.
Yep, I will do this for another reason as well: functions will be internally identified by ordinal numbers. So new functions must be appended at the end.

cajhin
Posts: 19
Joined: 29 Oct 2004 23:14

Post by cajhin »

(just thinking loudly here...)

Hmm. If you maintain two files in parallel (kb.dat and kb.ini), I wonder if your valuable time is well spent... the dat file is only used as a kind of 'cache' so you don't have to parse the ini every time, right?
How long does it take a somewhat modern PC to parse a hundred ini lines? I'd guess it is completely insignificant compared to the load time of the file (any file) from disk. Less than 1/100s if implemented with performance in mind? I'm not sure though.

About inline comments: I thought you'd write your own ini handler. (I always do, .NET does not support inis anymore; ick).

For the function identifier, I would only use a label (like 'refresh_tree'), not the full path from the GUI. Why? Sometimes you have to rearrange a menu, that's common; but it is generally a bad idea to rename items, so the item names / labels are usually much more stable.

An option: use the number IDs in the ini, too. Provide the item name / GUI label only as a hint for the user. Now you can rename functions without breaking the key mapping.

A custom ini might look like
[key]=[id] [label] ( [explanation] )

F5=86 Refresh Tree (updates the content blah)
Ctrl+R=86 Refresh Tree (second shortcut for f86)
=87 Refresh File List (blah blah)
=88 Reload key map (bb)

That way, you can immediately discard all lines that start with '='.
I really doubt that the remaining 5 (10? 20?) lines that have been customized take any time to parse.

Post Reply