-
Notifications
You must be signed in to change notification settings - Fork 44
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
Disabling Ctrl+P
or other browser shortcuts
#21
Comments
Your proposed fix has the downside of preventing of the print dialog from working, which if implemented would almost certainly create bug reports that this extension broke printing 🙃 Admittedly using Maybe something like https://chrome.google.com/webstore/detail/shortkeys-custom-keyboard/logpjaacgmcbpdkdchjiaagddngobkck would work in order to inject your js automatically? |
My idea would be to allow the disabling of these kinds of browser shortcuts. So if someone uses the print shortcut often, they can just leave it on. |
I accidently hit |
I have a similar problem with ctrl+o in firefox. I agree that it would be invasive if this extension changed browser shortcuts, but at least we could document in README some way to this manually. @BrendanMartin could you give more details on how you run this script? |
Now that we have a real settings file I'm open to re-considering this as an opt-in setting. If anyone wants to have a go at PR for something like this it's ok to |
JupyterLab now allows you to do this in your user preferences by adding following to the keyboard shortcut settings (Settings menu → Settings Editor → JSON Settings Editor [in the upper right hand corner] → Keyboard Shortcuts). However, as mentioned above, I don't think blocking browser shortcuts should become a default for the extension itself unless it directly conflicts with a keyboard shortcut used by the extension. Block Ctrl+P in vim Normal mode {
"shortcuts": [
Starts here
{
"command": "",
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-editMode",
"keys": ["Ctrl P"]
}
Ends here
]
} Block Ctrl+P in Jupyter Command mode {
"shortcuts": [
Starts here
{
"command": "",
"selector": ".jp-Notebook.jp-mod-commandMode",
"keys": ["Ctrl P"]
}
Ends here
]
} |
A summary of browser key bindings that have been suggested here to be blocked by the extension:
Based on the above, I will close this issue as completed and pin this issue. If you would like to suggest another key binding that we should consider blocking, please open a new issue. |
In insert mode, I sometimes hit CTRL-P when trying to hit CTRL-[ to leave insert mode. Unfortunately, Chrome launches the print dialog if you hit CTRL-P.
Right now I'm using this script as a bookmark to intercept it:
But was wondering if this is something we could integrate into this extension.
The text was updated successfully, but these errors were encountered: