Subject: FVWM: key to prelude a fvwm command

From: Frank Gruellich <[email-masked]>
Date: Mon, 22 Dec 2003 22:10:35 +0100

Hello,

I go now for several weeks with fvwm (now 2.5.8) and really love it.
But I'm still a beginner (I've said it, okay?).  I'm used to operate my
pc with keyboard mostly.  Now I'm confronted with the lack of keys.
Several times it happens, that I strike a programs internal hotkey and
realize immediatelly, that I bound a fvwm command to it.  As I don't
know, what programs I will use (let alone, which hotkeys they use) in
future times, I would like to remedy this problem at all.

My former 'window manager' (screen) has a neat feature: any screen
command is introduced by a special escape key (C-a by default). E.g. I
use C-a " to get my windowlist, C-a C-c to get a new window and so on.
Can I do something similar in fvwm?  Any resources where somebody had
done something like this?

Thanks in advance,
 regards, Frank.
-- 
Sigmentation fault
--
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: parv <[email-masked]>
Date: Mon, 22 Dec 2003 17:04:39 -0500

in message <[email-masked]>, wrote Frank
Gruellich thusly...
>
> I go now for several weeks with fvwm (now 2.5.8)
...
> Now I'm confronted with the lack of keys.  Several times it
> happens, that I strike a programs internal hotkey and realize
> immediatelly, that I bound a fvwm command to it.
...
> command is introduced by a special escape key (C-a by default).

You could create one key binding to a popup menu, which would have
each entry assigned a hot key...

  key c  A   4  Popup menu

  DestroyMenu  menu
  AddToMenu    menu "menu" Title
  + &w3m       Exec xterm -e w3m
  + &netscape  Exec netscape
  + &mozilla   Exec mozilla

...so after you press "Super_L-c, m" sequence, mozilla would be
executed.  It may create a flash effect if keys are pressed w/in very
short time period.

See fvwm(1) for details.

  - Parv

--

---

From: Erik Steffl <[email-masked]>
Date: Mon, 22 Dec 2003 15:36:40 -0800

> done something like this?

   if this is a PC (or at least you are using a PC keyboard) you can use 
win key, AFAIK no apps use it. e.g. win key + arros move between virtual 
screens, win key + delete closes the window etc.

   use xev to find out what your win key is (mine is Super_L) and use 
that or use xmodmap to make it whatever you want.

	erik

---

From: Frank Gruellich <[email-masked]>
Date: Thu, 25 Dec 2003 21:31:12 +0100

* Erik Steffl <[email-masked]> 22. Dec 03
> screens, win key + delete closes the window etc.

Oh... uhm... win key... always wondered, what it is good for... well,
I'm an idiot.  Thanks for pointing this (both, the key and the idiot).
I will use it, nevertheless this is not exactly what I am looking for.
Can I make fvwm to react only if I start with a special key sequence?  I
thought about something like calling a function, which creates all key
bindings, on the special key (call my fvwm command) and destroy all key
bindings immediately after this.  It would move fvwm out of the way of
all applications once and for all (as with screen).  Any hints on this?

Merry Xmas,
 regards, Frank.

---

From: Mikhael Goikhman <[email-masked]>
Date: Thu, 25 Dec 2003 20:45:29 +0000

> all applications once and for all (as with screen).  Any hints on this?

Do you mean something like this in 2.5.x:

  DestroyFunc Ctrl-Alt-F-Action
  AddToFunc   Ctrl-Alt-F-Action
  + I Key X A A Exec xterm
  + I Key C A A Exec xcalc
  # optionally put some flash window
  + I Schedule 5000 Key X A A -
  + I Schedule 5000 Key C A A -

  # Press Ctrl-Alt-F and then "x" or "c"
  Key F A CM Ctrl-Alt-F-Action

With this, you should press a key in 5 seconds otherwise it is timed out.
I think that the solution with a menu and its hot keys is good too.

Regards,
Mikhael.

---

From: Frank Gruellich <[email-masked]>
Date: Thu, 25 Dec 2003 22:30:14 +0100

* Mikhael Goikhman <[email-masked]> 25. Dec 03
> > > > [screen-like fvwm]
> > > [win key]
> > Can I make fvwm to react only if I start with a special key sequence?

Oh, this is kinda neat, thank you very much.

> With this, you should press a key in 5 seconds otherwise it is timed out.

The 5s are not perfect, but I will deal with it (or 2s).  Perfect would
be if I could press the special key (i.e. C-M-f) and it waits (for ever)
until I press the next key.  If it is a bound key, exec the command and
remove all key bindings, if not only remove all key bindings (perfect
screen behaviour).

> I think that the solution with a menu and its hot keys is good too.

I already did so.  Okay, I had
   Key Return      A       C               Menu MenuFvwmRoot Root 0 0
and changed it now to 
   Key Return      A       4               Menu MenuFvwmRoot Root 0 0
which is much better, 'cause it doesn't conflict with mozillas "Open
link in new tab".  The use of hotkeys in the menus is self-evident.  But
it doesn't help much with things like
   Key L           FISW    4               Current AnimatedMove -0p w0     Warp
(which I s%\<S\>%4%, too).

Thank you very much for pointing to Schedule,
 regards, Frank.

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 26 Dec 2003 00:12:42 +0000

> remove all key bindings, if not only remove all key bindings (perfect

And what happens if you mistakenly press the combination? I am almost
sure that a timeout is needed, at least I would like it.

But I see no problem to do what you want, i.e. to lock the keyboard
(actually some letter keys) until one of them is pressed. For 2.4.x+:

  DestroyFunc DisableKeysAndDo
  AddToFunc   DisableKeysAndDo
  + I Key Escape A A -
  + I Key X      A A -
  + I Key C      A A -
  + I $*

  DestroyFunc Ctrl-Alt-F-Dispatcher
  AddToFunc   Ctrl-Alt-F-Dispatcher
  + I Key Escape A A DisableKeysAndDo Nop
  + I Key X      A A DisableKeysAndDo Exec xterm
  + I Key C      A A DisableKeysAndDo Exec xcalc

  Key F A CM Ctrl-Alt-F-Dispatcher

Regards,
Mikhael.