[arch-general] Firefox Ctrl-W
Has anyone been able to figure out how to disable the Ctrl-W shortcut in Firefox? As a Vim user I'm constantly accidentally closing tabs when I want to delete the last word in a text field. It seems to be _very_ difficult to find a reliable method to do this short of recompiling Firefox. I use Plasma Desktop. If there's some way to filter events going to the browser window, that's a viable solution too, but I haven't found any way so far. Many thanks, Paul
Hi Paul,
Has anyone been able to figure out how to disable the Ctrl-W shortcut in Firefox?
Not me, but Ctrl-Shift-T immediately afterwards to re-open the just-closed tab often restores the text too. When it fails to do so tends to coincide with a high resulting loss. :-( -- Cheers, Ralph.
Hello Paul! Not a KDE user on my Arch Box, but I was able to achieve somewhat what you want on my Ubuntu 21.04 tablet with Plasma 5.21.4 under X11. It's a way to basically trigger certain actions (or not) through keystrokes, depending on the active window (among other things). This feature is hidden in the Settings under Shortcuts > Custom Shortcuts. There you can define a group that matches certain windows, like Firefox, and remap Ctrl+W via a so-called global shortcut (which is misleading, since the group defines that only Firefox windows should be matched). Some documentation I found online is this PDF from KDE [1]. Regards, Alex [1] https://docs.kde.org/trunk5/en/khotkeys/kcontrol/khotkeys/khotkeys.pdf "Paul Dann via arch-general" <arch-general@lists.archlinux.org> writes:
Has anyone been able to figure out how to disable the Ctrl-W shortcut in Firefox? As a Vim user I'm constantly accidentally closing tabs when I want to delete the last word in a text field.
It seems to be _very_ difficult to find a reliable method to do this short of recompiling Firefox. I use Plasma Desktop. If there's some way to filter events going to the browser window, that's a viable solution too, but I haven't found any way so far.
Many thanks, Paul
On Sat, 23 Oct 2021 at 18:49, alpabrz--- via arch-general < arch-general@lists.archlinux.org> wrote:
It's a way to basically trigger certain actions (or not) through keystrokes, depending on the active window (among other things). This feature is hidden in the Settings under Shortcuts > Custom Shortcuts.
There you can define a group that matches certain windows, like Firefox, and remap Ctrl+W via a so-called global shortcut (which is misleading, since the group defines that only Firefox windows should be matched). Some documentation I found online is this PDF from KDE [1].
Yes! Thank you; this is exactly the kind of thing I was looking for. I have several global shortcuts defined already, but what I had missed was the ability to add "conditions" to groups - that was the magic I was missing to catch the shortcut selectively by application. Thanks again; this will be *so* useful :p Paul
On 2021-10-22 11:56, Paul Dann via arch-general wrote:
Has anyone been able to figure out how to disable the Ctrl-W shortcut in Firefox? As a Vim user I'm constantly accidentally closing tabs when I want to delete the last word in a text field.
Yes. You can either patch Firefox sources and then build it yourself or hot-patch the binary after build. If you want the first approach, look up the patch from the repo of the author of Firenvim, I believe he maintains a source patch. If you want the latter approach you can use my patch script here: https://github.com/alerque/que-firefox/blob/master/bin/patch-firefox.sh Just note you have to run this every time you update Firefox. To my knowledge there are no other ways to make the CTRL+W hotkey combo into something you can configure yourself, it is just hard coded without being patched. Caleb
On Mon, 25 Oct 2021 at 21:16, Caleb Maclennan via arch-general < arch-general@lists.archlinux.org> wrote:
If you want the latter approach you can use my patch script here:
https://github.com/alerque/que-firefox/blob/master/bin/patch-firefox.sh
Just note you have to run this every time you update Firefox.
Thanks; I had actually previously tried manually unpacking and re-packing the omni.ja file, but the step to remove the startupCache was new to me. I'm afraid the patch still didn't seem to work for me. I have the Shortkeys extension installed and set to block Ctrl+W, but the tab still closed when I pressed the dreaded shortcut. So I guess there's still something I'm missing. But never mind - the solution using KWin to filter input to the window should work just fine for me for the time being. (At least until everything moves to Wayland :p) Cheers, Paul
On 2021-10-26 18:26, Paul Dann via arch-general wrote:
Thanks; I had actually previously tried manually unpacking and re-packing the omni.ja file, but the step to remove the startupCache was new to me.
The cache clear is important, but also a mistake people make trying to patch the omni.ja file is not padding the replacement with spaces so everything is still in the expected byte positions.
I'm afraid the patch still didn't seem to work for me. I have the Shortkeys extension installed and set to block Ctrl+W, but the tab still closed when I pressed the dreaded shortcut. So I guess there's still something I'm missing.
The patch doesn't change the key binding in Firefox, it only unlocks it from the reserved bindings list so that you *can* remove the assignment or assign it to something else. After patching you still need to go into your Firefox binding configuration and remove or re-assign the CTRL-W to something else. Caleb
participants (4)
-
alpabrz@protonmail.com
-
Caleb Maclennan
-
Paul Dann
-
Ralph Corderoy