Re: [firebreath-dev] Disable Alt+F4 and other combinations

357 views
Skip to first unread message

Richard Bateman

unread,
Sep 1, 2012, 11:39:57 AM9/1/12
to firebre...@googlegroups.com

There might be; is there a way in a linux desktop application to do that? it'd be the same way.

FireBreath doesn't give you any help with things like that. Obviously the plugin would have to be inserted into the page (instantiated) before such a thing would take affect. This is more a linux desktop programming question than it is a firebreath question; someone on the list may happen to know, but you'd probably have better luck in a venue dedicated to linux desktop development.

Richard

On Sep 1, 2012, at 07:08, Juzer Ali <er.ju...@gmail.com> wrote:

> Is there any way by which a FB plugin can prevent keypresses like Alt+F4, Ctrl+F4, Ctrl+W from propagating to the browser (or OS).
> Its okay if it propogates to OS coz I know how to not entertain the key press there. I just want a way to disable the keypress from reaching the browser
>
> Specifically on
> Linux Ubuntu 12.04
> Chrome 21.x
> Plugin does not draw.

Juzer Ali

unread,
Sep 1, 2012, 11:41:31 PM9/1/12
to firebre...@googlegroups.com
Hi Richard, 

Thanks for the quick reply.

From whatever little I know so far of window management, I've come to following conclusions:
 
1. Alt+F4 is global key combination for closing a window, this event bubbles all the way up to the OS. (On my OS I know how to disable this key combination, or any kind of key combination from closing the window altogether).

2. Ctrl+W, Ctrl+F4 are application specific. These keypresses are handled by application and do not bubble up to OS.

I've disabled Alt+F4 on my system, guess what happens. Firefox does not get closed by using this key combination, on the other hand Google Chrome and Opera does gets closed. It seems Firefox defers the Alt+F4 key combination to OS but apparently Chrome and Opera do not. Hence my question is pertinent to plugins that if they can prevent certain keypresses from reaching the browser? I know for sure that they can capture the events, as pointed out in FBTestPlugin which illustrates how to capture mouse movements. The question is, can their propagation be stopped? 

Reproducing this on SO.

Richard Bateman

unread,
Sep 1, 2012, 11:58:50 PM9/1/12
to firebre...@googlegroups.com

Plugins can only capture the events that the browser chooses to forward on. So in short, no.

Richard
Reply all
Reply to author
Forward
0 new messages