Enhanced key bar

Want to suggest an idea for a new plug-in? Know for sure what is needed for plug-in X to become the best? Write here.
Post Reply
pnecas
Posts: 11
Joined: Fri 27 Jul, 2012 16:39

Enhanced key bar

Post by pnecas » Thu 13 Sep, 2012 13:54

I have been using Far Manager for many years and I like it al lot, however I have always been lost in all the shortcuts I can use. I was thinking about enhancing the key bar with more keys to show all the available key shortcuts, based on the current context. I downloaded the Far Manager source and found that it would not be too difficult (even for me) to enhance the standard key bar. I did few changes in the code to prove my idea can be real.

The screenshot below shows available (not all) shortcuts while the Ctrl key was pressed in the shell view. Different set of key is presented when alt, shift+alt, sthift+ctrl, and also when viewer or in editor is opened.

Code: Select all

R════════════════════════ C:\_Far32b ═════════════════════════╗╔════════════════════════ C:\_Far32b ═════════════════════14:45
║n            Name             │             Name             ║║n            Name             │             Name             ║
║/..                           │                              ║║/..                           │                              ║
║/ConEmu                       │                              ║║/ConEmu                       │                              ║
║/Macros                       │                              ║║/Macros                       │                              ║
║/Plugins                      │                              ║║/Plugins                      │                              ║
║/Profile                      │                              ║║/Profile                      │                              ║
║•ConEmu.exe                   │                              ║║•ConEmu.exe                   │                              ║
║•conemu.xml                   │                              ║║•conemu.xml                   │                              ║
║•Far.exe                      │                              ║║•Far.exe                      │                              ║
║•Far.exe.ini                  │                              ║║•Far.exe.ini                  │                              ║
║•Far3Wrap.dll                 │                              ║║•Far3Wrap.dll                 │                              ║
║•FarEng.hlf                   │                              ║║•FarEng.hlf                   │                              ║
║•FarEng.lng                   │                              ║║•FarEng.lng                   │                              ║
║                              │                              ║║                              │                              ║
║                              │                              ║║                              │                              ║
║                              │                              ║║                              │                              ║
║                              │                              ║║                              │                              ║
║                              │                              ║║                              │                              ║
║                              │                              ║║                              │                              ║
║                              │                              ║║                              │                              ║
║                              │                              ║║                              │                              ║
║                              │                              ║║                              │                              ║
║                              │                              ║║                              │                              ║
║                              │                              ║║                              │                              ║
║                              │                              ║║                              │                              ║
╟──────────────────────────────┴──────────────────────────────╢╟──────────────────────────────┴──────────────────────────────╢
║/..                                       Up   13.09.12 14:38║║/..                                       Up   13.09.12 14:38║
╚════════════════ 3 827 549 bytes in 7 files ═════════════════╝╚════════════════ 3 827 549 bytes in 7 files ═════════════════╝
                                                            ▐+▐                                                            ▐+▐
Shell                                                                                                                         
F1 Hide/Show left panel F2 Hide/Show right panel F3 Sort files by name F4 Sort files by extension                             
F5 Sort files by modification time F6 Sort files by size F7 Keep files unsorted F8 Sort files by creation time                
F9 Sort files by access time F10 Sort files by description F11 Sort files by file owner F12 Display sort modes menu           
0 Set alternative full view mode 1 Set brief view mode 2 Set medium view mode 3 Set full view mode 4 Set wide view mode       
5 Set detailed view mode 6 Set descriptions view mode 7 Set long descriptions view mode 8 Set file owners view mode           
9 Set file links view mode A Set file attributes B Show/Hide functional key bar at the bottom line D Character right          
E Previous command F Insert full file name from the active panel G Apply command to selected files                            
H Toggle hidden and system files displaying J Insert current file name from the active panel K Delete to end of line          
L Toggle info panel M Restore previous selection N Toggle long/short file names view mode O Hide/show both panels             
P Hide/show inactive panel Q Toggle quick view panel R Re-read panel S Character left T Toggle tree panel U Swap panels       
X Next command Y Clear command line Z Describe selected files                                                                 

User avatar
Centaur
Posts: 1083
Joined: Tue 05 Apr, 2005 20:09
Location: Novosibirsk, Russia

Re: Enhanced key bar

Post by Centaur » Thu 13 Sep, 2012 14:49

That’s just horrible. You propose reserving half the screen just so that you can spend ludicrous amounts of time looking up shortcuts you can’t remember? Or resizing the panels each time one presses any of the modifier keys?

pnecas
Posts: 11
Joined: Fri 27 Jul, 2012 16:39

Re: Enhanced key bar

Post by pnecas » Thu 13 Sep, 2012 15:24

Thank you for the feedback. I agree this looks horrible, however this "big" key bar would be visible only when you need it and not all the time taking half of the screen. For example by pressing Ctrl-B, it can switch between standard key bar, extended key bar or hidden. Petr

User avatar
John Doe
Бюрократ
Posts: 11127
Joined: Wed 27 Apr, 2005 20:42
Has thanked: 12 times
Been thanked: 72 times

Re: Enhanced key bar

Post by John Doe » Thu 13 Sep, 2012 17:18

You can try to implement this bar as plugin.

User avatar
Centaur
Posts: 1083
Joined: Tue 05 Apr, 2005 20:09
Location: Novosibirsk, Russia

Re: Enhanced key bar

Post by Centaur » Fri 14 Sep, 2012 04:40

I still argue that:
  • first, your idea will cause a lot of annoying flickering whenever modifier keys are pressed;
  • second, finding the key for the function you want will not be easy (at least, you will have to remember if it is a Ctrl-key or an Alt-key or do a bruteforce of all modifier combinations, and then scan the whole of eleven lines of dense text);
  • third, over the many years, you should have already memorized all the shortcuts that are important for you;
  • and fourth, if you still want to show shortcut key hints, you might also want to include keyboard macros.
Instead, I suggest that you try F1 help for general keys and reading the menu for those functions that are included there.

pnecas
Posts: 11
Joined: Fri 27 Jul, 2012 16:39

Re: Enhanced key bar

Post by pnecas » Fri 14 Sep, 2012 06:45

First, I agree, the proposed form will be flickering, is ugly and cannot display all the available options, I'm think on some other way already. Second, the purpose is to show what the options are for the users are based on the current context, not show the help file with list all the key shortcuts. Third, maybe, but there might be others that would benefit from it, otherwise I would not post it. Forth, adding macro keys is also the plan.

cyberwolf
Posts: 109
Joined: Tue 24 Mar, 2009 14:39

Re: Enhanced key bar

Post by cyberwolf » Tue 18 Sep, 2012 08:08

Showing such a big key-bar would be bad, but ... you could always show a full-screen dialog with all the shortcuts (or at least those you can detect), like how Lightroom does it(If you press the CTRL+/ it will show an image similar to the next one http://www.craigfergusonimages.com/wp-c ... /lrdev.jpg).

The dialog could be context sensitive, for example while editing files you would see only the shortcuts that work with the editor.
Another idea is that while the dialog is visible, pressing any of the modifier keys (Shift, CTRL, ALT, ...) would modify what is visible, so, for example pressing CTRL+Shift would show only the shortcuts that need you to press Ctrl+Shift and another key.

Now, regarding the coding part, i don't know exactly how you could detect all the available shortcuts, for the keyboard macros you could probably read the registry or the settings file, but for shortcuts from plugins, well, I don't know if there's any API that can return used keyboard shortcuts.
Sorry for writing in English in the Russian forums, but i don't speak Russian and don't trust online translators. :D

"There’s no teacher who can teach anything new He can just help us to remember the things we always knew." ~ ENIGMA

pnecas
Posts: 11
Joined: Fri 27 Jul, 2012 16:39

Re: Enhanced key bar

Post by pnecas » Tue 18 Sep, 2012 14:15

Cyberwolf, I agree with you, I was also thinking about opening an external window (not in far) (either from a plugin directly or communicate with a separate application showing the window) with the available shortcuts based on the current context - Editor, Panel, Viewer, etc + keys Shift, All, Ctrl, Ctrl+Alt, etc. John Doe suggested to create plugin rather than modifying the far code. My chalenge now is how detect the pressed keys from a plugin, can somebody post me some code example?
Getting the plugin keys will probably also be a chalenge, maybe it can be read from the Far3 config database somehow.

pnecas
Posts: 11
Joined: Fri 27 Jul, 2012 16:39

Re: Enhanced key bar

Post by pnecas » Fri 16 Nov, 2012 16:04

I created the first version of the application as I described above, but I not sure how to publish it (if anybody would be interested). Can anybody suggest?

cyberwolf
Posts: 109
Joined: Tue 24 Mar, 2009 14:39

Re: Enhanced key bar

Post by cyberwolf » Fri 16 Nov, 2012 17:06

pnecas wrote:I created the first version of the application as I described above, but I not sure how to publish it (if anybody would be interested). Can anybody suggest?
I think you can attach an archive to your posts, maybe an admin or advanced user will give more detailed response.
Or if you have a site then you can post a link to that site.
Sorry for writing in English in the Russian forums, but i don't speak Russian and don't trust online translators. :D

"There’s no teacher who can teach anything new He can just help us to remember the things we always knew." ~ ENIGMA

pnecas
Posts: 11
Joined: Fri 27 Jul, 2012 16:39

Re: Enhanced key bar

Post by pnecas » Mon 19 Nov, 2012 13:50

http://webshare.cz/9zw5ypzRWW-key_helper.7z

1. Start the KeyHelper.exe (.NET 4 is required)
2. Start far.exe
3. in Far press Shift, Alt, Ctrl keys or its combination (showing available keys is shell, editor or viewer is supported for now)

Please let me know your feedback...

cyberwolf
Posts: 109
Joined: Tue 24 Mar, 2009 14:39

Re: Enhanced key bar

Post by cyberwolf » Tue 27 Nov, 2012 14:42

Sorry for the late reply, i was kind of busy.

Anyways, I've played a little with the KeyHelper program and it's a nice idea.

Here are a few ideas/suggestions to improve it :
1. from what i saw keyhelper doesn't seem to detect any other version of FAR than the one that comes in the archive, it should work with any version of FAR started from any folder. It would also be nice to also detect FAR instances that where started under ConEmu.
1.b. it would be nice to have it so that if it doesn't detect a FAR instance then it takes the CTRL/ALT/SHIFT keypresses from it's own window. This would be useful since for example I could check what key combination does what without having to start FAR
2. for now all settings are taken from the XML file, while it's a very good start (specially for new users who are not familiar with FAR) it would be nice to have it detect all shortcuts that are added by plugins/scripts to FAR (i know this won't be easy)
3. it would be nice to have it autohide/autoshow somehow, since it's an "always on top" application it takes up quite a lot of space. One idea is to add it to the F2 User menu (that would solve the autoshow part) and have it autoclose/hide on ESC key. There could also be an option to autohide after a certain amount of time (for example 30 seconds).
4. it would be nice to have it as a FAR plugin, that could replace the autohide/autoshow from the above point, it could still remain in a standard windows interface (and not ported to the FAR interface since there would probably not be enough place)
5. in a future version a search function would be useful, it would search in the descriptions of the shortcuts for the given word(s) and show me a list of shortcuts and their descriptions

The ideas above are just that, ideas, it's up to you to decide if they are worth the time/effort to implement (or if they can be implemented at all)
Anyways, for a first version it's more than I expected, keep up the work.
Sorry for writing in English in the Russian forums, but i don't speak Russian and don't trust online translators. :D

"There’s no teacher who can teach anything new He can just help us to remember the things we always knew." ~ ENIGMA

pnecas
Posts: 11
Joined: Fri 27 Jul, 2012 16:39

Re: Enhanced key bar

Post by pnecas » Tue 27 Nov, 2012 18:41

Thank you for the valuable feedback, please see my comments below:

1. Yes, I couldn't figure out how to write a plugin that would send the key states so I decided to modify the Far source code (any hints in this area are welcome as I'm not a programmer in nature), so it works now only with the Far in the archive. It is using named pipes for the communication between the both applications.
This modified Far version also works fine under Conemu.
1b. Good idea, I will implement this option.
2. I have already been thinking about this, I will try to implement this in any of the future versions.
3. Good idea, I will try to bring up some solution.
4. Agree, but I don't know how to create this plugin at this moment, can you please suggest?
5. Search capability is a good idea. I will try to implement it.

I would also try to implement more context dependent help, for example for Ctrl-F1 keys when the panel is hidden show "Show left panel" and when is displayed show "Hide left panel". But I’m not sure how to do it now.

Post Reply

Return to “Suggestions and Ideas”