Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notebook -- make it easy to configure keyboard shortcuts #7618

Closed
williamstein opened this issue Dec 8, 2009 · 2 comments
Closed

notebook -- make it easy to configure keyboard shortcuts #7618

williamstein opened this issue Dec 8, 2009 · 2 comments

Comments

@williamstein
Copy link
Contributor

Tom:
>> It's really easy to configure the keyboard shortcuts -- perhaps that
>> should be an entry in the settings page?

William:
> Yes, definitely.  Could you post some remarks in an email about how
> you think adding keyboard shortcut configuration should be
> implemented... and probably I'll implement it as a result.

Tom Boothby:
Well, right now there's some functionality to statically change the
keyboard shortcuts through config.py.  IIRC, there's a global
dictionary of keyboard shortcuts which establishes a mapping

'name' -> [(modifier1, key1), (modifier2, key2), ... ]

and when the user requests the main javascript file, this is compiled
into javascript.

I think that it'd be easy to implement this for users -- from their
settings page, they could override the server's config.py.  If the
user had a dictionary  similar to the above, that would be loaded
after the global config.  This would give the user an opportunity to
add or override shortcuts.


For example, say the global configuration results in

Shortcuts = { 'eval' : [('shift', 'enter')], 'break cell':
[('ctrl','semicolon')]}

But, the user also wants shift-tab to break cells.  So, they go to the
shortcuts settings page, scroll down to the "break cell", and add that
entry.  Now, their settings would contain (for example... I have no
idea how the settings are implemented)

user.settings['shortcuts'] = {'break cell' : [('ctrl','semicolon'),
('shift','tab')]}

Note that they haven't modified 'eval', so that doesn't get put into
their settings.  This way the user's settings dictionary is spliced
into the global settings when we render the javascript (so new
features will work without the user manually adding them).

Note that the input handler (I think) always returns once it's
identified a shortcut as having been pressed, so we don't need to
check if a particular shortcut is unique.  Otherwise, it could be
great fun to map everything to a master "do everything always" key.
Maybe an unmodified spacebar.

I think that the actual input form for this should be pretty
self-explanatory -- but I can describe what I'm thinking for that too,
if you want.

CC: @fchapoton

Component: notebook

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/7618

@williamstein williamstein added this to the sage-5.11 milestone Dec 8, 2009
@williamstein williamstein self-assigned this Dec 8, 2009
@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe
Copy link
Member

mkoeppe commented Aug 18, 2020

comment:5

Proposing to close all sagenb tickets as outdated, so that all remaining open tickets in the notebook component are about the Jupyter notebook.

@mkoeppe mkoeppe removed this from the sage-6.4 milestone Aug 18, 2020
@dimpase
Copy link
Member

dimpase commented Aug 25, 2020

Reviewer: Dima Pasechnik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants