That's cmd+alt+0, not cmd+shift+0. cmd+shift+0 wouldn't have worked, as it's identical to cmd+= on some European keyboards, and that's already assigned to zoom in for whatever reason (shouldn't that be cmd++ instead?).
Fit to Height shortcut not implemented
It is implemented (see pd_menus.js, line 355) and it works just fine on Linux, but for some reason on the Mac the cmd+alt+h keyboard shortcut doesn't show in the menu (and doesn't work). I have no idea why, seems to be yet another Mac-only nw.js weirdness. @jwilkes do you have an idea why the shortcut isn't recognized on the Mac?
I tried cmd+alt+0 with OSX, but it appears to trigger the "Reset Zoom" menu item, which has a shortcut of cmd+0.
@jwilkes
Jonathan Wilkes
do you have an idea why the shortcut isn't recognized on the Mac?
It appears that cmd-h hides the window. So in both of these cases the alt key either isn't getting recognized as part of the shortcut or OSX is somehow preempting nw.js getting that shortcut.
I tried cmd+alt+0 with OSX, but it appears to trigger the "Reset Zoom" menu item, which has a shortcut of cmd+0.
That doesn't happen for me. On OSX 10.10, cmd+alt+0 works fine for me, every time. Are you sure that you didn't use it with an example where optimal zoom just happened to be zoom 0?
Anyway, we can try to find shortcuts that work better on the Mac. Also, I can live without the fit-to-width/height shortcuts, but I really need the optimal zoom shortcut, I'm using that all the time.
Ok, I can see why cmd+alt+h is problematic now. According to https://support.apple.com/en-us/HT201236 it's bound to "view the front app but hide all other apps" by default. cmd+alt+w is problematic for similar reasons. cmd+alt+0 should be ok, AFAICT, but of course we can change it.
FWIW, cmd+9 is "zoom to fit" in Apple's preview application, so that seems to be a reasonable choice for our "optimal zoom". In fact, it's more convenient than cmd+alt+0, too. There doesn't seem to be any kind of standard for the other two, though. I'd like to suggest the following:
cmd+9: optimal zoom
cmd+alt+9: fit to width
cmd+shift+9: fit to height
I guess that these should work on Linux and Windows, too (using ctrl in lieu of cmd). The mnemonic for the lesser-used operations would be that alt is usually besides cmd/ctrl, so "fit-to-width", while shift is usually above cmd/ctrl, so "fit-to-height". Yeah, it's not very creative, but that way we still have some keybindings for these two, and I hope that I can remember them that way. YMMV. ;-)
Just tried this on my MacBook running OSX 10.10, all three bindings are displayed properly in the menu and work all right for me. I've attached a suitably modified pd_menus.js below so that you can both give it a try yourself (for rc1 this goes into /Applications/Pd-l2ork-full-x86_64-20161120.app/Contents/Resources/app.nw).
@jwilkes if you're fine with this then I can send you a merge request.
I just tested this on Linux, works fine there, too, so I've committed this to my release branch now. @jwilkes you may still want to give it a whirl on Windows. I'll send you a merge request in a minute.