M HYPE SPLASH
// general

Disable hardwired chrome hot key ctrl+w?

By John Peck

Using Chrome's Remote Desktop I would like to pass Ctrl+W to an application on the other PC but that actually closes my Chrome window. Any way of disabling shortcut keys in Chrome?

I searched through the web but didn't find any hacks. I added the shortcut manager extension but that can't manage the Ctrl+W shortcut or some other shortcuts.

7 Answers

Only solution that worked for me was to rebind ctrl+w to some extension keyboard shortcut.

  1. go to chrome://extensions

  2. at bottom right look for keyboard extensions

  3. add ctrl+w as shortcut to any chrome extension you like.

Now, ctrl+w does not close the browser tab.

3

It's extremely annoying since Ctrl+W is the vim equivalent of Ctrl+Backspace. I wrote this little Tampermonkey script to temporarily place an event listener on the page unload event:

// ==UserScript==
// @name disable ctrl+w
// @namespace
// @version 0.1
// @description disable ctrl+w
// @match
// ==/UserScript==
document.addEventListener('keydown', function(evt){ // NOTE: ctrl key is sent here, but ctrl+W is not if (evt.ctrlKey) { var stopEvilCtrlW = function(e) { return "Oopsies, Chrome!"; }, clearEvilCtrlW = function() { window.removeEventListener('beforeunload', stopEvilCtrlW, false); }; setTimeout(clearEvilCtrlW, 1000); window.addEventListener('beforeunload', stopEvilCtrlW, false); }
}, false);
1

The ctrl+w key is used in the nano editor on linux systems. When using crosh in Google chrome this key combination results in a prompt to close the current window.

Try using ctrl+alt+w

Works for me when connecting to remote systems via ssh using crosh.

2

I am an extensive VIM user, and I had the same issue. Installing "Chrome Remote Desktop" app and using it to connect instead of using "Google Chrome" tab resolved the issue for me.

Most of the solutions don't work anymore. I want to use nano text editor with CTRL+W key in my linode lish web gui, in order to search for a text, I need to use CTRL+W key but that just terminated my window.

In chrome browser, if you pin the browser window, then if you press CTRL + W it will also close the browser window.

but,

in opera browser, if you pin the browser window, then if you press CTRL + W it will not close the browser window.

So, my solution is to use Opera Browser.

On the your system on which CRD window opens, create custom keyboard shortcut "Do nothing" enter echo as a command. Bind it to Ctrl+w. It disables it. Just tried a second ago and it worked.

hmmm... I understand your question, but the "Ctr + W" command closes the current tab in any browser not just google chrome.

My research did find people who have solved this issue:

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy