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

Enable PageUp / PageDown to support navigation with remote pointers #50

Open
nthiery opened this issue Aug 31, 2023 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@nthiery
Copy link
Contributor

nthiery commented Aug 31, 2023

Elevator Pitch

Remote pointers typically send PageDown and PageUp events to navigate
through slideshows. It would be therefore handy if jupyterlab-deck supported
these shortcuts.

PageDown: display the next fragment/subslide/slide
PageUp: display the previous fragment/subslide/slide

So presumably PageDown and PageUp could simply be aliased to space and shift-space
(assuming I got their purpose correctly; see #49).

Thanks in advance!

@nthiery nthiery added the enhancement New feature or request label Aug 31, 2023
@bollwyvl
Copy link
Contributor

As it stands, these can already be customized through settings:

{
  "shortcuts": [
    {
      "command": "deck:go",
      "keys": [
        "PageDown"
      ],
      "args": {
        "direction": "forward"
      },
      "selector": ".jp-Deck"
    },
    {
      "command": "deck:go",
      "keys": [
        "PageDown"
      ],
      "args": {
        "direction": "back"
      },
      "selector": ".jp-Deck"
    }
  ]
}

Otherwise: it's difficult to anticipate everyone's needs, and thus far those needs have been mine and the few people who wanted this built. On my box when presenting (as I don't have another device), space is big and easy, pgup and friends are tiny and useless, so it never crossed my mind.

Theoretically, there could be another settings stanza that offered a number of pre-baked schemes, but any current work will be driven by just keeping up with the upstreams, a la #36.

@nthiery
Copy link
Contributor Author

nthiery commented Aug 31, 2023

Thanks for the feedback! I confirm that shortcut configuration works. Up to one point, if I got it right:
space (and similarly shift-space) is a compound key that actually runs two commands: down and forward.
Is that achievable with shortcut configurations, or would it require to create a new command subsuming
down+forward (which possibly could be best named forward, calling down+right, where right is the current forward?).

For information: I experimented with editing the sources, and adding the following
compound keys in token.js line 195, and that worked smoothly (up to #49):

  [[DIRECTION.down, DIRECTION.forward], ['PageDown']],
  [[DIRECTION.up, DIRECTION.back], ['PageUp']],

Should you accept that as a reasonable default configuration, I can prepare a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants