Subject: FVWM: Forcing FVWM to pass all key/mouse events to a program.

From: Ben Logan <[email-masked]>
Date: Fri, 25 Jan 2002 21:25:51 -0500

Hello,

I have recently switched to FVWM2, and am a fan so far.  I like the
ability to configure practically everything.

I often run an X-session over VNC (server and client both run on Linux
machines), and would like for FVWM to ignore all of my key/mouse
events when the mouse is over (or focus is on) the VNC client's
window.  IOW, I want FVWM to pass those events on to the window,
usually because I want the FVWM running over VNC to receive them.

Is there any way to accomplish this?  I looked in the manpage, and saw
the mention of this in the section on ICCCM compliance--it looked like
I might be up the creek without a paddle. :)  I just wanted to make
sure before I gave up.

Thanks, and please be sure to CC me, as I'm not a member of the list.
Ben

P.S.
I tried searching the list archives, but every search I performed
turned up 0 results--even when my only keyword was fvwm!  I assume it
is temporarily broken?

-- 
Ben Logan: ben at wblogan dot net
OpenPGP Key KeyID: A1ADD1F0

All men are mortal.  Socrates was mortal.  Therefore, all men are Socrates.
		-- Woody Allen
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Sun, 27 Jan 2002 16:48:59 +0100

On Fri, Jan 25, 2002 at 09:25:51PM -0500, Ben Logan wrote:
> Is there any way to accomplish this?

Yes, but not easily.  Most bindings are somewhere in your
.fvwm2rc, e.g.

  mouse 1 t n move
  key f1 a m foobar
  ...

and some are found in the ConfigFvwmDefaults file that comes with
fvwm.

If you put all of them in one fvwm function and the commands to
disable them in another, you can switch the bindings on an off
when the pointer enters the VNC window with FvwmAuto or
FvwmEvent.  It's a bit difficult to get this right.  You don't
want to re-add the bindings every time the focus changes because
it costs a lot of time.  This is what I finally came up with:

--------------------------- snip --------------------------
DestroyFunc activate_bindings
DestroyFunc remove_bindings
DestroyFunc do_activate_bindings
DestroyFunc do_remove_bindings

AddToFunc AddAllBindings
+ I Mouse 1 T A Function MoveOrRaise

AddToFunc RemoveAllBindings
+ I Mouse 1 T A beep

AddToFunc activate_bindings
+ I Function do_activate_bindings
+ I DestroyFunc do_activate_bindings
+ I DestroyFunc do_remove_bindings
+ I AddToFunc do_remove_bindings I Function RemoveAllBindings

AddToFunc remove_bindings
+ I Function do_remove_bindings
+ I DestroyFunc do_activate_bindings
+ I DestroyFunc do_activate_bindings
+ I AddToFunc do_activate_bindings I Function AddAllBindings

AddTofunc focus_change_event
+ I WindowId $0 (FvwmConsole) Function remove_bindings
+ I WindowId $0 (!FvwmConsole) Function activate_bindings

AddToFunc do_remove_bindings
+ I Function RemoveAllBindings

AddToFunc StartFunction
+ I AddAllBindings
+ I Module FvwmEvent

AddToFunc EnterEvent
+ I WindowId $0 (!raised) Raise
*FvwmEvent: PassId
*FvwmEvent: focus_change "Silent focus_change_event"

Style FvwmConsole MouseFocus, MouseFocusClickRaisesOff
--------------------------- snip --------------------------

This example works with FvwmConsole.  You'll have to replace that
with the VNC window's unique name or resource.  I think this works
best with MouseFocus, so I set this explicitly at the end.  The
AddAllBindings and RemoveAllBindings should contain all key
bindings and all mouse bindings that work on the client window.
You can leave mouse bindings on the title, buttons, border or the
root window activated all the time.

Unfortunately that does not work with any released version.  I
discovered a bug that caused infinite focus_change events while
the pointer was over the FvwmConsole window.  You can either
download tomorrow's snapshot or wait for the 2.5.0 release.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].