Hello,
I’m working on a port of jupyterlab that runs on iPhones and iPads.
One of the issues is extending the on-screen keyboard so that users have access to most useful commands (cut, copy, paste, run cell…) (see picture: from left to right: undo, redo, tab, shift-tab, cut, copy, paste, up, down, execute cell).
The way I can do it easily is by calling JavaScript commands that get executed (I used --expose-app-in-browser
). For example, the up button corresponds to:
webView.evaluateJavaScript("window.jupyterapp.commands.execute('notebook:move-cursor-up');")
I’ve been able to do most of the commands I wanted to do using commands.execute
. Now I’m left with commands where the action to be taken depends on the status of the notebook: the “tab” button can either indent code or call autocomplete, depending on whether there is some text to the left of it (same for shift-tab). “Cut” should either cut a cell (if we’re in command mode) or cut the text inside a cell (if we’re in edit mode). I know there is an internal variable that tells whether the notebook is in edit mode, but I cannot find a way to access it.
I have tried with window.jupyterapp.commands.processKeydownEvent(event);
for tab, but it did not work.