Subject: FVWM: Dynamically assigning keybings.

From: Nuno Alexandre <[email-masked]>
Date: Sun, 26 Dec 2004 20:34:19 +0100

Hi everyone,
I have a question about keybindings, and wether it is
possible to dynamically assign keybindings depending on the
application being used.
I'd like to disable/re-map some keybindings to other keys so
that the current maps dont interfere with the application in
use, this could be some 3D application which makes intensive uses of
the Meta+mouse buttons.

So the idea would be like, specifying all the keybindings
for all situations, and then, depending if the window class
	would match, a set of keybindings would become active
	overrulling the set already mapped.
	When the application exits, the keybindings revert to
	their "original" state.

	Anyone have some pratical way of accomplish this?
	Thanks.

Regards,
-- 

Nuno Alexandre	>
mail		: ikaro@fluxbox dot org
web		: http://ikaro.dk

--
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: Mark Gray <[email-masked]>
Date: 27 Dec 2004 09:27:32 -0500

> 	Anyone have some pratical way of accomplish this?

Since nobody answered, I doubt that doing _exactly_ what you describe
is possible at the moment.  But you might want to try what I do (which
I consider to be a better solution).  I have set up Scroll_Lock as a
modifier in my ~/.Xmodmap and use it to "toggle" fvwm keybindings
totally off or on.  You have to make sure that all of your "A" (Any)
modifier fvwm keybindings are changed to "N" (None) (unless of course
you do not want to toggle that particular keybinding), and that you do
not list Scroll_Lock in your fvwm "IgnoreModifiers" command.

To add Scroll_Lock as you mod5 modifier (if it is not that already),
add the following to the end of your ~/.Xmodmap

clear mod5
add mod5 = Scroll_Lock

So far I have only run into one and only one application which even
noticed that Scroll_Lock was on: Turbo Pascal 4.0 running inside
xdosemu, and the fvwm keybinding toggle effect still worked for it.

This solution has the added advantage of turning the Scroll Lock light
on and off to remind you that the fvwm keybindings are disabled.

Hope this helps.

---

From: Bjoern Steinbrink <[email-masked]>
Date: Mon, 27 Dec 2004 16:25:11 +0100

> 	Anyone have some pratical way of accomplish this?

You could define a set of functions that setup all keybindings that
change when you switch applications and call them using FvwmEvent.

DestroyFunc Keybinds_A
DestroyFunc Keybinds_B

AddToFunc Keybinds_A I Key Key1 A A ThisFunc
AddToFunc Keybinds_B I Key Key1 A A ThatFunc

AddToFunc Keybinds_A I Key Key2 A A ThisFunc2
AddToFunc Keybinds_B I Key Key2 A A ThatFunc2

DestroyFunc Change_KB
AddToFunc Change_KB
+ I ThisWindow (MyApp) Keybinds_A
+ I ThisWindow (!MyApp) Keybinds_b

*FvwmEvent-Keybinds: focus_change Change_KB
Module FvwmEvent FvwmEvent-Keybinds

HTH
Bjoern

---

From: Mikhael Goikhman <[email-masked]>
Date: Tue, 28 Dec 2004 15:59:12 +0000

> possible to dynamically assign keybindings depending on the

Starting with 2.5.11, you may specify a window name in Key and Mouse
commands, see examples in the man page:

  http://fvwm.org/documentation/manpages/unstable/fvwm.php?theme=plain#lbBR

Regards,
Mikhael.