Closed theck3r closed 4 years ago
Hi
That sounds pretty exciting, and I've wished I had a way to customize hard-wired shortcuts for a long time now; and I can see you've spotted the original discussion on that matter
I had other ideas about how to deal with that, but that's going to be for some other time - if ever, actually..
so on the principle I'm fine; I'm not sure when I will have a chance to release this; our plans were to focus on the jlab thing, but that has gotten a little stuck in the meantime, so I guess the classic notebook extension still has some future; I guess it would belong in a 5.6.1.dev
if it's not too much hassle, I'd love if you could extend this patch to cover the home
and end
functions as well among the parametrizable features ?
also, do you see any impact on the documentation as shown at rise.readthedocs.io ?
thanks !
I have just pushed some updates including the extension for the home
and end
keys you asked for. Actually I tried to cover all bindings that were directly assigning keycodes to reveal.js API calls or RISE functions (so I have included e.g. toggleOverview, toggleAllRiseButtons,...).
To add some more structure I have now split up the RISE/reveal.js and the chalkboard bindings in nbconfig. I have added a short chapter to the documentation (good hint), which I hope explains the idea. Additionally I have moved some code blocks into functions to make the whole thing a bit more versatile. So adding custom key bindings to further API calls should now be easier.
If we would only support to make the native key customization via the nbconfig JSON (not nbextension_configurator
) the whole thing could easily be simplified and would be more flexible (i.e. just define a list of dicts with keyboard shortcut and API call). But of course this is not as intuitive to use as having predefined bindings in the configurator and if there is not many requests for further customized reveal.js bindings, it's probably not that interesting.
as I said I'm going to need to find some time to play with this, but it sounds promising indeed thanks !
it's a little embarrassing because our focus is not the master
branch but the maint-5.6
instead
my bad entirely, this is not documented anywhere..
anyways, I've merged, I'll see how it goes
all right, so here's where i am
rise.yaml
to come after the original section on keystrokesat this point what I see as remaining issues is
it's my feeling that the yaml file should come with more defaults; I mean for exemple we have 'firstSlide' bound to 'home' - or at least we used to have, and it should remain so
so we should IMHO have that reflected in the yaml file as a default for rise.reveal_shortcuts.main.firstSlide
I have only made a quick test, I can't see anything broken but I was not able to configure things through the configurator - which honestly is not conclusive as I have recently changed a lot of my environment, so I can't tell for sure where the configurator is saving things and whether it affects my dev. miniconda or not...
in any case, if you plan to make any further change, please start from the maint-5.6 branch; feel free to open another PR in that case, as I think it's the most convenient way given that change
thanks !
@damianavila it'd help if you were able to do some tests on this on your end
@theck3r thank you very much for this work!
Hi, I have added some code to customize the keyboard short cuts for the chalkboard (as most of the hard wired default keys are not available on my german keyboard).
I guess this is not the perfect solution (read the discussion in #442), but it allows using some custom hotkey fields in nbconfig and converts the key-strings into key codes, which are then passed to the RevealChalkboard setup (could be used for other reveal.js keys as well, I guess...).
Conversion is done by a pretty simple string concatenation of the nbconfig key-shortcut string(s) to KeyEvent's VirtualKeyboardConstants (DOMVK...) - falls back to the default key codes, if no match is found. I also added some code for updating the Rise help accordingly - so the help menu should always show the user defined shortcuts (if they could be converted).
Seems to work well on my system - linux/firefox (although some DOMVK... constants are missing), but I am rather new to javascript, so any feedback is welcome.
regards, Thies