Currently keyboard shortcuts are implemented via 2 ways:
There are some issues with this:
We probably should introduce a notion of commands (something akin to WM_COMMAND ids but as strings).
We should allow defining mapping of keyboard shortcut => command in settings file (with defaults in the code).
In code we need a map of menu items => command.
We no longer should include shortcut string in menu string to be translated but it should come from the mappings (menu item => command => keyboard shortcut). They also need to be translated.
Implementation wise, we can either handle all shortcuts in window message loop or use apis to build accelerator tables from the mappings.
The keyboard assignments ( and context menu options )
should be in "SumatraPDF/SumatraPDF-Settings.TXT", I think.
I would love this feature as well, especially since I have a mouse with back and forward buttons and would love that for page navigation.
@GregTheHun
This topic is about remapping key combinations, though that could possibly include the basic left, right and middle click. Many multi-button mice can be programmed to suite different apps,. They should have their own remapping app and the Microsoft mouse app can do that for SumatraPDF. As far as I know it also works with other brands.
At least for mine in particular (Logitech M570), it doesn't as far as I'm aware.
@GregTheHun Using Logitech I can run X-Mouse and use these settings specifically for SumatraPDF

Yeah, but why run another piece of software, if it can be relatively easy to implement a shortcut mapper? I hate running small apps that do very specific things for other apps
It might be easy to remap one key for one user but at last count there were 21-22,000 translated items and many groups of 300 are tied to different key mappings for about 70 languages, you may note I use English but American is not the language of my forefathers. Many users have asked for conflicting mappings and it may make sense to leave them entirely to user preference, but someone needs to do that and no one has stepped forward.
Any news about this feature in 2019? :)
I started to use this and like/support the simplicity of this reader. The biggest issue is that the bookmarks are fully expanded and I can't collapse them without a num key.
Reference pdfs can have a huge number of bookmarks and the hierarchy is the saving grace in dealing with them deftly. I can't collapse them.
Unfortunately the num keys have disappeared from the newer laptops and adding another key remap app seems to be counter to the simple pdf reader philosophy.
Like Einstein said, "Everything should be made as simple as possible, but no simpler".
Lots of way to solve this. One would be to allow key mapping in the settings.txt file. I think there are other ways to start collapsed or expanded preferences but this thread is about mapping so I'll stop here.
@alkgrove for your specific need I agree remapping would be one answer, do you have access to F6 to switch focus ? then if you also have arrow keys or similar, windows uses those to expand and contract bookmarks
Indeed the F6 does highlight one bookmark and can collapse or expand that bookmark. That is pretty handy for manipulating individual bookmarks.
This works for individual bookmarks but doesn't solve the global all expanded or all collapsed issue. Most of the other readers start with the bookmarks collapsed and this is my preference. It is easy to see all the chapters in a short list and dive down from there. I imagine some people do like them expanded and this is default for Sumatra PDF. There is a key stroke that expands all and collapses all, except it isn't on either of my two Lenovo laptops unless I add a USB number keypad (Lenovos suggestion) or use a key map software.
The number keys have disappeared from many computer keyboards and should not be relied on unique operations, in this case expand all and collapse all.
So this as a feature request to have an alternate solution to num pad keys to selecting all expanded or all collapsed.
Thanks,
Bob
@alkgrove I agree a seperate key is required
however SumatraPDF does not "expand all on opening" the level of bookmarks is usually determined by the author thus if only one level is included then Sumatra will obviously display that one level but if nested the author may set all level 1 or 2 to be expanded etc.
Once you expand and contract THEN SumatraPDF will attempt to remember the "last setting" per file.
if you exit with ALL expanded then the next time ALL will be expanded
I think if you to jump to top entry with HOME and the bookmarks are correctly nested below the first entry THEN left arrow will collapse all but there is no way windows allows for expand all other than [num *]
Note num * does NOT expand all sections only the focused section
Again it is up to the author to provide a Root bookmark that will allow expand all levels
I stand corrected. Right, it seems most of my pdfs were saved expanded.
I did find a work around but it is entirely clunky. This Lenovo under windows 10 has an On-Screen Keyboard. Open up the onscreen keyboard and click Option key to bring up a dialog to turn on the number pad. You then click Num-Lock key so the number pad really is the number pad. You then use F6 to focus on book marks, and Shift - NumPad / to collapse all the bookmarks.
I use arrow keys a lot for navigating but they fortunately expand or collapse only the focused book mark one level. I couldn't find numpad usage in the manual, I found it in the forums so not much info. From playing with it, it looks like as long as you have focus in the bookmark, shift numpad /, collapses the entire tree at all levels. and shift numpad * expands the entire tree for all levels.
I missed this post first time through: https://forum.sumatrapdfreader.org/t/feature-request-fold-unfold-bookmark-tree-via-shift-or-ctrl-f12/51, but it looks like it was brought up a few years ago. So I'd upvote that feature request.
Regarding bookmarks tree view:
@kjk great
a few errors snuck into manual page "kyboard" and " * colapse... should be " / collapse... (note the double ll )
@kjk tried keys in 3.2.11351 guess I may be premature ?
There could be a clash with / as already set to "find"
The clearest unused pair or key combo I see on all keyboards here is [ ] and { }
@GitHubRulesOK thanks, fixed the typos.
Regarding * and / : they've been there for a long time, just not documented. They might only work when in numeric keyboard, which most laptops and many modern keyboards sadly don't have.
I think Enter (that I just added) provides all functionality, as it does both collapsing and expanding and with Shift-Enter does it recursively.
So Enter can do the job of both * and / and s available on all keyboards.
@kjk Yes enter is even beter than / attached is a 1 page dummy file that emulates outline bookmarks (fairly well) using shifted / does not close ALL leaving level 1 showing but ENTER at root entry closes ALL
TestOutline.pdf
@kjk still one minor error on manual
still says " * = collapse " should be " / = collapse "?
@GitHubRulesOK thanks again, editing html sucks.
@kjk your misstypes are not as bad as my dodgy fingers and this knackered keyboard plus this firefox has no spellcheck to warn me :-)
"Me too!" comments are generally useless but I solipsistically ignore that objection to register my support for the concept of self-customising via the settings file. And/or to satisfy my own peculiar and selfish requirement (maybe via hard coding?):
pressing left alt + spacebar in SumatraPDF opens the File menu, duplicating the action of just pressing the left alt key.
unversally/by default (?) in Windows applications pressing left alt + spacebar opens the window manager menu (Restore - Move - Size - Minimize - Maximize - Close) (the last being actioned by c or alt + F4).
Force of habit ingrained over decades to muscle-memory makes it easy to close a program by pressing left alt + spacebar then hitting the nearby key c -- program closed! I know SumatraPDF quits via q, but that's idiosyncratic.
Great program also for DjVu (the scanned file format preferred by readers -vs- collectors) and displays their bookmarks/outlines unlike (surprisingly) DjVuLibre.
(Windows 7 Home Premium x64, EN (GB)).
[edited after the event]
The lack of ALT Space in tabbed mode was a regression issue within version 3.2 It has now been addressed in pre-release version 3.312429 and should thus be included in release 3.2.1 onwards
@caganer: Good catch! Since LAlt by itself and F10 both open the hamburger menu and the nested Window menu has been removed in 3.2 (here's how it looked), Alt+Space definitely needs to be mapped back to the standard System menu.
For reference purposes here's the commit that added the system icon and got rid of the nested Window menu.
@kjk What are the news on this topic ? Is this feature still considered ?
PS: Thx a lot for your work btw.
Most helpful comment
The keyboard assignments ( and context menu options )
should be in "SumatraPDF/SumatraPDF-Settings.TXT", I think.