Keyboard shortcuts on Linux

Hi,

I am having troubles using keyboard shortcuts (prev/next cell, move cell up/down) on Linux (Xubuntu, Firefox and Chrome). I have tried literally all combinations of ctrl/alt/shift/win(cmd)/up/down and nothing happens. I have currently no means of reordering cells in my notebooks.

Thanks,
Ondrej

also see

Perhaps your window manager intercepts ? Since it is impossible to support all distros, dragging cells would be a platform independent solution.

In KDE, you can disable just for Chrome all window manager keyboard shortcuts in:

  • More Actions ā€¦ Special Application Settings - Appearance and Fixes tab - Ignore global shortcuts = Force: yes

It works for me to get the Observable Alt-Window-arrows keys to work for rearraging cells.
There may be a similar settings for your window manager.

So, some more updates:

  1. my Linux WM (xfwm) does not seem to be intercepting those, as literally nothing happens when I hit them (w.r.t. window manager)

  2. I also tried at Windows 10 (non-customized vanilla install). Observed windows behavior:

  • In Firefox, there is no way to navigate (alt+shift+up/down) and no way to swap (alt+win+up/down);
  • In Chrome, alt+shift+up/down also does nothing. Swapping works!

To sum things up: the one and only keyboard shortcut that I managed to get working is alt+win+up/down AND windows AND chrome. All other combinations are doing nothing interesting.

Thatā€™s the only one that works for me too. Only in Chrome, not in Firefox. Same result on Ubuntu 16.04 Unity and Windows 7. Havenā€™t tried Gnome or KDE.

It only works on KDE Chrome with disabled wm shortcuts for me. Firefox does not work for me as well.

The current keybindings for non-Mac systems are (verbatim from the code that implements them):

  • Alt-Shift-Down: move focus down
  • Alt-Shift-Up: move focus up
  • Cmd-Alt-Up: move cell up
  • Cmd-Alt-Down: move cell down
  • Shift-Enter: run cell
  • Alt-Enter: split cell
  • Shift-Alt-Enter: split cell
  • Alt-Backspace: merge
  • Ctrl-Alt-D: merge
  • Shift-Ctrl-P: toggle pin
  • Ctrl-Alt-Tab: insert tab

Might want to try this keyboard debugger to see if the keystrokes youā€™re typing are getting through to the browser. Iā€™m planning on implementing UI for shortcut-only commands, because, as weā€™ve found is that every key combination is going to break on some particular platform.

2 Likes

After turning off global wm shortcuts, on linux FF 52.7.3 the Cmd (keycode 91)-Alt (18) - Up (38)/Down(40) keys get logged by the keyboard debugger but still do not work in the editor. Chrome 66.0.3359.139, however, works.

Hi Tom,

thanks for the debugger link! This is a really useful tool. Some observations on Linux/XFCE:

  • Firefox: alt+shift generates Key: ā€œGroupNextā€, KeyCode: 18;

  • Chrome: alt+shift generates Key: ā€œGroupNextā€, KeyCode: 0;

  • Firefox: alt+win generates Key: ā€œOSā€, KeyCoode: 91;

  • Chrome: alt+win generates Key: ā€œMetaā€, KeyCode: 91.

Another difference between keyboard shortcuts for Windows/Linux and Mac where Observable seems to hard-code the Mac version is:

Description Windows Mac OS
Redo text Ctrl + Y Shift + Cmd + Z

Update: cells now have up & down buttons

21%20PM

Someday soon weā€™ll make them draggable to make re-arranging simpler, and possibly someday thereā€™s some sort of peace between browsers, OSes, and keyboards to make keybindings work everywhere.

4 Likes

Great work guys.

possibly someday thereā€™s some sort of peace between browsers, OSes, and keyboards to make keybindings work everywhere

Donā€™t hold your breath for this one ā€¦

Great, Tom, thanks a lot!

This is great. Much appreciated.

I noticed that ā€œsplit cellā€ isnā€™t mentioned in the hovertext, maybe a nice addition?

image

Iā€™m on Chrome and MacOS and redo (Ctrl+Y) is opening up my history instead of redoing. Is there a way to get it to redo?

Shift+Cmd+Z

1 Like