Re: FVWM: Question regarding actions when modifier keys are held down/released

Dave Weller-Fahy <[email protected]>
Newsgroups gmane.comp.window-managers.fvwm
Message-ID <[email protected]>
* Stephen Dennison <[email protected]> [2019-08-29 09:25 -0400]:
>On Thu, Aug 29, 2019 at 8:43 AM Dave Weller-Fahy <[email protected]> wrote:
>> On Thu, Aug 29, 2019 at 2:16 AM Martin Cermak <[email protected]> wrote:
>> > On  Wed  2019-08-28  13:03 , Dave Weller-Fahy wrote:
>> > > My goal is to have the following rules followed.
>> > >
>> > > Rules about keys being pressed and (possibly) held.
>> > > - If Ctrl-Alt are pressed ...
>> > >   - and if no other keys are pressed within some period of time ...
>> > >     - then pop up the pager
>> > >   - and if other keys (such as arrow keys) are pressed ...
>> > >     - then execute some other action
>> > >
>> > > Rules about keys being released.
>> > > - If Ctrl-Alt are released ...
>> > >     - and if the pager is displayed ...
>> > >       - then remove the pager
>> > >
>> > > The use case is to have Ctrl-Alt-(up|down|left|right) change desks,
>> >
>> > I have this setup too (as an option).  But primarily I use
>> > Ctrl-Alt-(<keypad key 1..9>).  This gives me a clear idea which
>> > of my 9 desks (arranged as a 3x3 matrix) I am switching to.
>> > Nothing visual involved.
>>
>> I was reaching the conclusion that what I wanted was not possible
>> with fvwm (at least, not possible without an external utility), but
>> figured I would check with the mailing list before giving up and
>> looking for an external utility to help. I may also try fvwm3 to see
>> if what I want is possible there.
>>
>
>You can bind a key to a modifier and set the unbound one as your
>modifier (Key Control_L A M Exec exec executable.name    or  Key Alt_L
>A C Exec exec executable.name   or ...) And that can still be used for
>some other action (Key T A CM Exec exec other-executable.name would
>still work, for example) but it will cause your executable to be
>executed even when you're just using the alt and control as modifiers.

Hrm... I'd tried to do that, and completely forgot about _L/_R, instead
I focused on Alt. That's an interesting thought on your part, and I'll
have to play with that tomorrow (tonight is for bed). The key here is
that the pager coming up should be brief... and I'm beginning to
rethink the "must come up before the direction key is pressed".

>You could make a wrapper script that uses xlib and does a
>`display.query_keymap()` to see if the keys are still being held down.
>Then if after a set time the key isn't still held, you might decide
>that the wrapper was invoked intentionally and should then call a
>function in fvwm to toggle your pager.  It would take a little getting
>used to, as you'd train yourself to hold modifier keys for a brief
>pause when executing stuff other than toggling the pager, but it's not
>impossible.

Another interesting idea - although I think I'm starting to lean toward
having the pager pop up when the desk change is initiated, and then the
only problem is how to allow multiple desk changes without releasing the
Ctrl-Alt keys, and how to make sure the pager closes after releasing the
keys.

>I had experimented with using the windows key to do something on its
>own when not being used as a modifier key, but I eventually discarded
>it.  I posted about it to the fvwm forums, which can be found here:
>https://fvwmforums.org/phpBB3/viewtopic.php?f=6&t=2832#p14222

Hrm... I get all kinds of warnings when I access that page, and no
information in any of the three posts. Is there another place to access
the information?

Regardless, thanks for all the good idea fodder... now I'll go dream
about this, and play with it tomorrow.

Regards,
  -dave
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EARECAB0WIQRJZAdtCeMuFIIFC8vNqGiRc5vZTAUCXWiNswAKCRDNqGiRc5vZ
TI8fAJ4+Q7KhP7gMLdQVLNEA8pt47NQ9uQCfYl52S2lXxcVleE9whr4SweMv5SA=
=Nh7E
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.