Subject: FVWM: question about key bindings

From: Ram Bhamidipaty <[email-masked]>
Date: 14 Sep 2002 07:02:25 -0700

Is it possible to setup a keybinding so that it works everywhere
except for one particular window?

I have this in my .fvwmrc2 file:

Key F1     WFSIT  N  RaiseLower
Key F2     WFSIT  N  Iconify

I would like the F1 and F2 keys to work for all windows except
for one particlar window. How do I do that?

I also use VNC. This means that I have a normal desktop plus there is
a window on the desktop that is itself a full desktop. When I hit
F1 or F2 I want that key to go to the VNC desktop...

I'm running  2.2.4. Thanks for any help. I am not on the fvwm mailing
list.

-Ram

--
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: Mikhael Goikhman <[email-masked]>
Date: Sat, 14 Sep 2002 15:06:18 +0000

> for one particlar window. How do I do that?

It is possible to ignore the binding for one (or more) specific widnow.
In recent versions (2.4.6+) this should be used:

  Key F1     WFSIT  N  ThisWindow (!MySpecialWindow) RaiseLower

In previous versions this may work (probably in 2.2.x, but I didn't test):

  Key F1     WFSIT  N  WindowId $w (!MySpecialWindow) RaiseLower

($$w should also work here, since one dollar would be eaten by Key.)

> F1 or F2 I want that key to go to the VNC desktop...

I don't think this is easily possible. Once you defined a key inside "W",
it is captured in all windows. You may try to send synthetic key events,
but I don't think it will work.

The most relable solution I see is to bind Shift-F1 for raising windows.
Or, instead, use F1 as usual, but press Shift-F1 to pass it to VNC.
Or even press Num-Lock, then F1 should be passed to your window as well.

> I'm running  2.2.4. Thanks for any help. I am not on the fvwm mailing

Consider to upgrade.

Regards,
Mikhael.

---

From: Cameron Simpson <[email-masked]>
Date: Sun, 15 Sep 2002 10:07:31 +1000

On 15:06 14 Sep 2002, Mikhael Goikhman <[email-masked]> wrote:
| On 14 Sep 2002 07:02:25 -0700, Ram Bhamidipaty wrote:
[...]
| > I also use VNC. This means that I have a normal desktop plus there is
| > a window on the desktop that is itself a full desktop. When I hit
| > F1 or F2 I want that key to go to the VNC desktop...
| I don't think this is easily possible. Once you defined a key inside "W",
| it is captured in all windows. You may try to send synthetic key events,
| but I don't think it will work.
| The most relable solution I see is to bind Shift-F1 for raising windows.
| Or, instead, use F1 as usual, but press Shift-F1 to pass it to VNC.
| Or even press Num-Lock, then F1 should be passed to your window as well.

The other approach you might use, which is certainly uglier, is what
I use: I have two styles. My normal one,"zen", has no titlebars or
handles etc.  Consequently, I have lots of keybindings to the "W"
context to manipulate windows.

When I have a VNC desktop up I have exactly your problem. So I also have
a style "nested" which has titlebars etc, purely to provide handles for
dragging things around without requiring key bindings. Thus:

	[...]
	Style "zen"	UseStyle "general", NoTitle, NoHandles, BorderWidth 0, HandleWidth 0
	Style "nested"	UseStyle "general", Title, BorderWidth 2, HandleWidth 2, BackingStore, SaveUnder
	Style "*"	UseStyle zen
	[...]
	DestroyFunc SetModeZen
	AddToFunc SetModeZen	I	DestroyStyle "*"
	+			I	Style "*" UseStyle "zen"
	+			I	Recapture
	DestroyFunc SetModeTitled
	AddToFunc SetModeTitled I	DestroyStyle "*"
	+			I	Style "*" UseStyle "nested"
	+			I	Recapture
	[...]
	Mouse 					1 R N		Menu Menu1
	DestroyMenu Menu1
	AddToMenu Menu1		"Menu1"		Title
	[...]
	+			"Zen Mode"	SetModeZen
	+			"Titled Mode"	SetModeTitled

Ugly, but it at least makes the VNC desktop manipulable.

Cheers,
--
Cameron Simpson, DoD#743        [email-masked]    http://www.zip.com.au/~cs/

My opinions are borrowed from someone who no longer needs them.
	-- [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].