Subject: FVWM: Catching keypress based on time

From: Bob Vloon <[email-masked]>
Date: Wed, 25 Sep 2002 11:05:20 +0200

Hi,

Would it be possible to trigger an event when, for example, one presses the
CTRL key for a certain time? I imagine something like this:

- press CTRL for a second
- pop up dialog
- press additional key to trigger another event (becomes key combination
  CTRL+<key>)

I suppose it's possible and - to me ;) - it would be rather nice..

Regards,

  Bob
--
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: Dan Espen <[email-masked]>
Date: Wed, 25 Sep 2002 09:24:00 -0400

> I suppose it's possible and - to me ;) - it would be rather nice..

It might be possible, but not without source code changes.

-- 
Dan Espen                           E-mail: [email-masked]
444 Hoes Lane  Room RRC 1C-214      Phone: (732) 699-5570
Piscataway, NJ 08854
--
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: Wed, 25 Sep 2002 16:24:52 +0200

> It might be possible, but not without source code changes.

Wrong :-)  Don't underestimate fvwm's scripting features, Dan.

You can get a rough approximation of that behaviour with 2.5.x:

  Key Control_L A A Schedule 1000 1234 Menu RootMenu
  Key F1        A C SomeOtherActionAndDeschedule
  AddToFunc SomeOtherActionAndDeschedule
  + I Deschedule 1234
  # insert custom actions below here
  + I WindowShade
  ...

This solution has a few drawbacks:

 1) The timing may not be accurate and vary.
 2) It effectively disables the left control key in all
    applications.  You should better use a modifier key that no
    application knows about.
 3) You have to issue the "Deschedule ..." line for every action
    that may be triggered with the key.
 4) When the key is released before the timeout, the menu still
    pops up after a second.

There is little you can do about the first two.  The latter two
can be solved once we have a "KeyRelease" command that allows
triggering actions when a key is released.  With that, we could
add

  KeyRelease Control_L A A Deschedule 1234

(Wow, sometimes even I am surprised what you can do with fvwm!)

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, mail: [email-masked], phone: 0721/91374-382
Schlund + Partner AG, Erbprinzenstr. 4-12, D-76133 Karlsruhe
--
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: Dan Espen <[email-masked]>
Date: Wed, 25 Sep 2002 10:45:27 -0400

Dominik Vogt <[email-masked]> writes:
> > > Would it be possible to trigger an event when, for example, one presses
> > > the CTRL key for a certain time? I imagine something like this:
> > > 

If you guys don't stop adding features, I'm going to have to
stop trying to answer questions. :)

I hesitated to answer this one.  It seems like every time I think
Fvwm can't do something I'm proven wrong.