Can I delete (or modify or supplant) the alt+f4 shortcut?

Discuss various technical topics not related to Mozilla.
Post Reply
Odin2
Posts: 801
Joined: March 10th, 2012, 8:08 pm

Can I delete (or modify or supplant) the alt+f4 shortcut?

Post by Odin2 »

I use an add-on to access my toolbar bookmarks by alt+, according to position, and often use alt+4. The problem is that I sometimes hit alt+f4 in error--and close Fx.This could be solved if I could inactivate the alt+f4 shortcut, or alternatively if I could supplant it to cause a less problematic action--or if I could modify it to require confirmation. Is any of these possible?
User avatar
DanRaisch
Moderator
Posts: 127188
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: Can I delete (or modify or supplant) the alt+f4 shortcut

Post by DanRaisch »

Moving to MozillaZine Tech as this is not a Firefox Support issue but either OS or add-on related.
morat
Posts: 6405
Joined: February 3rd, 2009, 6:29 pm

Re: Can I delete (or modify or supplant) the alt+f4 shortcut

Post by morat »

You can use the keyconfig extension to disable Alt+F4 in Thunderbird 60.

http://addons.thunderbird.net/thunderbird/addon/602486

Unfortunately, the keyconfig extension isn't compatible with Firefox Quantum.
User avatar
jscher2000
Posts: 11742
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: Can I delete (or modify or supplant) the alt+f4 shortcut

Post by jscher2000 »

I have created an experimental extension that keeps a window open when you try to close it. If you want to test it out:

https://addons.mozilla.org/firefox/addo ... ng-window/

It uses the (usually) annoying "do you want to leave the page" prompt to do this, so you can't disable that feature.

Right now, it only protects 1 regular window and 1 private window. If I get time, I'll add more options.
Odin2
Posts: 801
Joined: March 10th, 2012, 8:08 pm

Re: Can I delete (or modify or supplant) the alt+f4 shortcut

Post by Odin2 »

Jefferson, this extension is just what I want--except that it's not working for me. I've followed your instructions, made sure the about:config preferences were as you stipulated, pinned the Keep Open tab, and restarted Fx--but alt+f4 closed Fx as usual, without any warning or prompt.
User avatar
jscher2000
Posts: 11742
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: Can I delete (or modify or supplant) the alt+f4 shortcut

Post by jscher2000 »

Odin2 wrote:I've followed your instructions, made sure the about:config preferences were as you stipulated, pinned the Keep Open tab, and restarted Fx--but alt+f4 closed Fx as usual, without any warning or prompt.
What is the "restarted Fx" step?

I'm actually having a completely different problem in a new profile: when I "Leave page" Firefox stays in memory and doesn't exit properly. Something I need to solve so Firefox can exit.
Odin2
Posts: 801
Joined: March 10th, 2012, 8:08 pm

Re: Can I delete (or modify or supplant) the alt+f4 shortcut

Post by Odin2 »

After executing the add-on I clicked "Restart normally" at about:profiles. In retrospect that should have been unnecessary since I had not changed any configurations (?). But it seems you're saying that the add-on's operation is imperfect anyway. I'll try again if/when you say so.
User avatar
jscher2000
Posts: 11742
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: Can I delete (or modify or supplant) the alt+f4 shortcut

Post by jscher2000 »

I changed the extension so that page unpins itself before exit. Otherwise, it is restored as sort of an inert/broken tab. So that part should work better now.

Even so, when exiting, it's safest to click "Stay on Page" and "Close This Tab" rather than selecting "Leave Page" at shutdown. Otherwise the shutdown sometimes seems to stall. I need to get some expert advice on why that's happening because it definitely isn't obvious to me.
Odin2
Posts: 801
Joined: March 10th, 2012, 8:08 pm

Re: Can I delete (or modify or supplant) the alt+f4 shortcut

Post by Odin2 »

Just great, Jefferson!

Apparently the instruction to pin the tab is for the user's convenience, so it will always be available. I am not willing to pin it, as doing so makes it identifiable only by Fx's generic globe icon, which I use elsewhere. If I ever lose my tabs, I will just restore this.
User avatar
jscher2000
Posts: 11742
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: Can I delete (or modify or supplant) the alt+f4 shortcut

Post by jscher2000 »

Oh, does it work without pinning? I thought I was adding the "beforeunload" listener when you pinned. I will need to make that optional? And fix the icon...
Odin2
Posts: 801
Joined: March 10th, 2012, 8:08 pm

Re: Can I delete (or modify or supplant) the alt+f4 shortcut

Post by Odin2 »

Yes, it has worked just fine without being pinned. And a non-generic icon would indeed be welcom.
Post Reply