Re: Stop alt-spacebar window menu



On 05/27/2009 09:45 PM, Emmanuel Rodriguez wrote:
On Wed, May 27, 2009 at 9:04 PM, Brian J. Tarricone<bjt23 cornell edu>wrote:

Bill Farmer wrote:

I am porting a native windows application to linux gtk. I want to stop the
alt-spacebar key combination popping up the application window menu. This
can be done in windows by capturing the WM_SYSCHAR message. After searching
though the gtk documentation and sources, the only way I can see to do this
is by copying a file from the gdk sources, modifying it, and compiling it
with the application.

You probably will not have any success doing this unless you are able to
control the user's environment.  Things work differently on X11 than on
Windows.  The alt+space key combo is likely handled by the window manager,
which will eat the key and react to it and not even pass it on to your
application.

I'd suggest not using shortcuts that use only alt as the modifier. While
there's no standard relating to this, usually those end up getting
"reserved" for use by the window manager, or for accessing menus via the
keyboard.

Gnome-terminal allows the user to map keyboard shortcuts using the alt key.
You could take a look at their code an see how they do it

No, you've missed the point. Setting alt+ shortcuts is certainly possible. There's nothing special you have to do that's different from using any other modifier key. But if the window manager has grabbed a particular key *combination* for its own use, there's absolutely nothing you can do about it.

        -brian



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]