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

2019-11-10 Thread Dave Weller-Fahy
On Wed, Sep 4, 2019 at 11:32 PM Stephen Dennison  wrote:
> Well, as Thomas Adam points out, you can just use FvwmPager
> -transient. You can then use up/down/left/right to move towards a
> page, then hit any key to dismiss it. With just -transient it wont
> show other desks, so you'd have to pick the number of desks you want
> and provide that as a max. For example, I use five here (for six
> desks):
>
> Key Alt_L A C FvwmPager -transient 0 5
>
> ...
>
> But really, use Thomas's suggestion, as usual, it's terse and entirely
> on point.

Ok, it took me a while to get back to this. I've been trying different
configurations and simplifying, and have come up with a solution for
now. The transient option did not behave as I desired, as it required
me to hit a key or button to make the pager go away, at least as I had
it configured. There is still a bit of tweaking to do, but this works
and is close enough to the ideal behavior (from my perspective), that
I'll stick with it for a while.


First, my configuration is as follows (these are all the entries in my
`.fvwm/config` file that I thought were relevant):

#v+
# Set debug variable.
InfoStoreAdd DEBUG true

# Virtual desktops
DesktopName 0 main
DesktopName 1 vm
DesktopName 2 code
DesktopName 3 other
DesktopSize 1x1

# Give hints to ewmh compliant pagers and taskbars.
EwmhNumberOfDesktops 4

# Set focus style to SloppyFocus, and a mouse click raises a window.
Style * SloppyFocus, MouseFocusClickRaises

# Minimize overlap with other windows measured by pixel area.
Style * MinOverlapPlacement

# Use the rubber-band outline style when resizing windows.
Style * ResizeOutline

# Allow windows/icons to snap to other windows/icons, respectively, if
# they come within 15 pixels of the other object. All can snap to the
# screen edge.
Style * SnapAttraction 15 SameType ScreenAll

# Style for the pop-up pager.
Style PopUpPager PositionPlacement screen 0 100-100w 0-1p
Style PopUpPager !Borders, CirculateSkip, FixedPosition, FixedSize, !Handles, \
 StaysOnTop, Sticky, !Title, WindowListSkip

# Function: ShadeIt - START
#
# $0: Name of window
# $1: Shaded state (Shaded or !Shaded)
# $2: ToBeShaded (True or False)
# $3: Target layer
# $4: Post shade action (usually Raise or Lower)
#
# If a window named $0 exists and is in state $1, then apply shade
# state $2 to it, place it in layer $3, then take action $4 (usually
# Raise or Lower).
DestroyFunc ShadeIt
AddToFunc ShadeIt
# Log function entry and parameters.
+ I Test ($[infostore.DEBUG]) \
 Echo < ShadeIt (0: $0) (1: $1) (2: $2) (3: $3) (4: $4)

# If no window of this name exists then log it and break out.
+ I None ("$0", CirculateHit) Echo | ShadeIt - no such window
+ I TestRc (Match) Break

# If it does exist and is in state $1, then apply shade state $2, ...
+ I Next ("$0", CirculateHit, $1) WindowShade $2
+ I TestRc (Match) KeepRc Test ($[infostore.DEBUG]) \
Echo | ShadeIt - '$0' shaded state to $2 based on $1

# ... place it in layer $3, ...
+ I TestRc (Match) Next ("$0", CirculateHit, !$1) Layer 0 $3
+ I TestRc (Match) KeepRc Test ($[infostore.DEBUG]) \
Echo | ShadeIt - '$0' placed in layer $3

# ... and execute $4 on it.
+ I TestRc (Match) Next ("$0", CirculateHit, !$1) $4
+ I TestRc (Match) KeepRc Test ($[infostore.DEBUG]) \
Echo | ShadeIt - $4 '$0'

# Function: ShadeIt - END

# Function: ToggleShade - START
#
# $0: Name of window
# $1: Command to execute
#
# Check for window named $0. If not found, execute $1. Once found,
# toggle shade state of $0 (shade if unshaded, unshade if shaded).
#
# Found: https://fvwmforums.org/wiki/Tips/TogglingWindows/
DestroyFunc ToggleShade
AddToFunc ToggleShade
+ I Test ($[infostore.DEBUG]) Echo < ToggleShade (0: $0) (1: $1)
+ I None ("$0", CirculateHit) $1
+ I TestRc (Match) KeepRc Test ($[infostore.DEBUG]) \
Echo | ToggleShade - '$0' opened
+ I TestRc (Match) Wait "$0"

# Check to see if the target window is shaded and, if so, unshade.
+ I Next ("$0", CirculateHit, Shaded) \
 ShadeIt "$0" Shaded False 6 Raise
+ I TestRc (Match) Break

# Check to see if the target window is unshaded and, if so, shade.
+ I Next ("$0", CirculateHit, !Shaded) \
 ShadeIt "$0" !Shaded True 0 Lower

# Function: ToggleShade - END

# Function: ChangeToDesk - START
#
# $1: Name of the pager to show when changing.
# $0: Change the view by this number of desks.
#
# Change desks downward (if $1 = 1) or upward (if $1 = -1), unshade
# the window named $0, and schedule it to shade each time the desk is
# changed to get it out of the way.
DestroyFunc ChangeToDesk
AddToFunc   ChangeToDesk
+ I Test ($[infostore.DEBUG]) Echo < ChangeToDesk
# Step 1: Display $0 by unshading if window name provided.
+ I Test (!EnvMatch 0 "") \
Next ("$0", CirculateHit, Shaded) ShadeIt "$0" Shaded False 6 Raise
# Step 2: Change desks.
+ I GotoDesk $1 0 3
+ I Test ($[infostore.DEBUG]) \
Echo | ChangeToDesk - Go to the desk $[desk.n]: $[desk.name$[desk.n]]
# Step 3: Desc

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

2019-09-05 Thread Thomas Adam
On Wed, Sep 04, 2019 at 11:30:48PM -0400, Stephen Dennison wrote:
> Sorry about that.  It worked briefly but now it seems it has been
> "archived".. I presume that someone saw mention of the errors and went
> off to either fix it or just archive the content off to make it
> available elsewhere...

It's dead, Jim.  To be replaced with something newer, sometime soon.

> But really, use Thomas's suggestion, as usual, it's terse and entirely on
> point.

:)

-- Thomas Adam



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

2019-09-04 Thread Stephen Dennison
> 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.

Well, as Thomas Adam points out, you can just use FvwmPager
-transient.  You can then use up/down/left/right to move towards a
page, then hit any key to dismiss it.  With just -transient it wont
show other desks, so you'd have to pick the number of desks you want
and provide that as a max.  For example, I use five here (for six
desks):

Key Alt_L A C FvwmPager -transient 0 5

So, have a pager that shows 5 desktops (and however many pages you've
already defined), summon that pager by hitting ctrl and then alt
(because control is used as the modifier) and use the arrow keys to
move from page to page.  The pager just seems to support doing this,
using arrows to move page to page, I mean.  I don't know where this is
documented.  I just happened to notice it when I was testing it.

To move a desk, you'd need another keybinding.  Unless there is some
other key for this, as I'm not even sure where the arrow keys are
documented.

But you might want to use different keys for moving by a full desk.
Either way, here's how you could move a desk up or down, again using
zero to five desks (total of size):
Key Right A CM GotoDesk 1 0 5
Key Left A CM GotoDesk -1 0 5

Because it uses the same keys as those for summoning the pager you
might get some drawing oddities, but it will still move like it's
supposed to.  This doesn't quite fit your desire of dismissing after
landing on your target desk, though, so you mgiht just want to use
ctrl + arrow to move (get rid of M modifiers above) so it doesn't
interfere with the pager.  This will allow the pager to stay up until
you dismiss it with something (like space or enter or any key other
than arrows, I think).  So be sure to do something like this, too:

Style FvwmPager Sticky, StaysOnTop

>
> >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?

Sorry about that.  It worked briefly but now it seems it has been
"archived".. I presume that someone saw mention of the errors and went
off to either fix it or just archive the content off to make it
available elsewhere...
It was a filthy hack anyway.  Essentially I re-assign stdout to dev
null so that I can import xlib, which will complain about something I
can't recall to standard out which fvwm would choke on from a
piperead, then I tested to see if a modifier was still held down
within a certain timeout so that I could ignore any long presses, eg
presses where the modifier was being used as a modifier to press some
other key because it took longer to do that then it did to just whack
the modifier as a bound key.  Then I wrote the command I wanted Fvwm
to run to FvwmCommand.

But really, use Thomas's suggestion, as usual, it's terse and entirely on point.



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

2019-08-29 Thread Dave Weller-Fahy

* Stephen Dennison  [2019-08-29 09:25 -0400]:

On Thu, Aug 29, 2019 at 8:43 AM Dave Weller-Fahy  
wrote:

On Thu, Aug 29, 2019 at 2:16 AM Martin Cermak  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-().  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.nameor  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
Description: PGP signature


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

2019-08-29 Thread Dave Weller-Fahy

* Chris Siebenmann  [2019-08-29 16:11 -0400]:

I've searched the website, archives, wiki, and a number of
configuration websites, and have been unable to find a way to cause
an action to happen when a modifier key is held down and/or released.
I'm running fvwm 2.6.8 on CentOS 7.


It's possible that you'll be able to build an interface similar to
what you want to do with the xcape program combined with some FVWM
configuration tricks:

https://github.com/alols/xcape


Interesting: this might be useful, thank you!


This gets you a way to get a preview, but it doesn't give you the kind
of UI flow that you were interested in initially. You'd be doing 'tap
something, look, hit Ctrl-Alt arrow key to act, tap to dismiss' or the
like, instead of being able to start out by holding down Ctrl-Alt,
waiting, and then continuing with another key.

(Possibly you can contrive more FVWM functions and FvwmEvents settings
and so on so that the pager is automatically dismissed after the desk
changes, or just after a timeout time.)


I think my "see the pager just before I decide which way to go" ideal
may have to fall to the pragmatic "see the pager just after I decide
which way to go so I can verify the direction, distance, etc. of the
journey." I'll keep chugging away at it, though, because I think it'll
be useful if I can get it to work.

Regards,
 -dave


signature.asc
Description: PGP signature


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

2019-08-29 Thread Dave Weller-Fahy

* Thomas Adam  [2019-08-29 09:35 -0400]:

On Wed, Aug 28, 2019 at 01:03:32PM -0400, Dave Weller-Fahy wrote:

Greetings,

I've searched the website, archives, wiki, and a number of
configuration websites, and have been unable to find a way to cause
an action to happen when a modifier key is held down and/or released.
I'm running fvwm 2.6.8 on CentOS 7.


This has always been historically tricky.


At least it's not easy: if it were easy I'd feel really dumb for missing
it. :)


The use case is to have Ctrl-Alt-(up|down|left|right) change desks,
but, if one wants, then holding Ctrl-Alt before pressing the arrow
key will pop up the pager so you can see the desks to which you will
be changing.


A lot of the replies here have been utterly overkill, for what should
be as simple as:

FvwmPager -transient


Thank you! I missed that bit entirely (especially about the "when button
released"), however it seems that doesn't do what I'd expect. I think I
misinterpreted "button" to mean "key or button", but in this case it
seems to be just "button", as in "mouse button". I created a small
function called ChangeToDesk with just the pager call (with -transient)
and a GotoDesk command, and bound it to Ctrl-Alt-Down.

#v+
Style FvwmPager StaysOnTop, Sticky

Key Down A CM ChangeToDesk 1

# Function: ChangeToDesk $0
#
# Change desks downward (if $0 = 1) or upward (if $0 = -1).
DestroyFunc ChangeToDesk
AddToFunc   ChangeToDesk
+ I Test ($[infostore.DEBUG]) Echo "< ChangeToDesk"
+ I Module FvwmPager -transient PopUpPager 0 3
+ I Test ($[infostore.DEBUG]) Echo "| ChangeToDesk - FvwmPager"
+ I GotoDesk $0 0 3
+ I Test ($[infostore.DEBUG]) Echo "| ChangeToDesk - GotoDesk"
#v-

My attempts to use this configuration are below.

1. I hit Ctrl-Alt-down.
2. The pager pops up, and I change desktops.
3. No other arrow keys will cause the desktop to change again until I
  release Ctrl and Alt.
4. Releasing Ctrl and Alt does not cause the pager to close.
5. Hitting any other key causes the pager to be closed.

This is closer, and with some other options I may be able to get closer
still. Thanks again for the information about transient.

Also, on a side note, is there any chance that fvwm3 will have more
flexibility with regards to acting upon keyboard presses, holds, and
releases because of the restructuring?

Regards,
 -dave


signature.asc
Description: PGP signature


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

2019-08-29 Thread Chris Siebenmann
> I've search the website, archives, wiki, and a number of configuration
> websites, and have been unable to find a way to cause an action to
> happen when a modifier key is held down and/or released. I'm running
> fvwm 2.6.8 on CentOS 7.

 It's possible that you'll be able to build an interface similar to
what you want to do with the xcape program combined with some FVWM
configuration tricks:

https://github.com/alols/xcape

 xcape generates keyboard events when you tap a key, including a
modifier key. You can make this keyboard event be some weird key and
modifier combination that you don't otherwise use and will never hit,
and bind that to a FVWM function that summons and dismisses the pager.
If you already have an existing FVWM keybinding that does this, so
much the better.

(For instance, I bind my left control to F5 with all of control, shift,
and alt down, and then have a 'Key F5 A CSM ...' binding in my fvwmrc.
This way xcape and that keybinding isn't stealing something that I ever
want to actually use.)

 This gets you a way to get a preview, but it doesn't give you the kind
of UI flow that you were interested in initially. You'd be doing 'tap
something, look, hit Ctrl-Alt arrow key to act, tap to dismiss' or the
like, instead of being able to start out by holding down Ctrl-Alt,
waiting, and then continuing with another key.

(Possibly you can contrive more FVWM functions and FvwmEvents settings
and so on so that the pager is automatically dismissed after the desk
changes, or just after a timeout time.)

- cks



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

2019-08-29 Thread Thomas Adam
On Wed, Aug 28, 2019 at 01:03:32PM -0400, Dave Weller-Fahy wrote:
> Greetings,
> 
> I've search the website, archives, wiki, and a number of configuration
> websites, and have been unable to find a way to cause an action to
> happen when a modifier key is held down and/or released. I'm running
> fvwm 2.6.8 on CentOS 7.

This has always been historically tricky.

> The use case is to have Ctrl-Alt-(up|down|left|right) change desks,
> but, if one wants, then holding Ctrl-Alt before pressing the arrow key
> will pop up the pager so you can see the desks to which you will be
> changing.

A lot of the replies here have been utterly overkill, for what should be as
simple as:

FvwmPager -transient

Kindly,
Thomas



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

2019-08-29 Thread Stephen Dennison
On Thu, Aug 29, 2019 at 8:43 AM Dave Weller-Fahy
 wrote:
>
> On Thu, Aug 29, 2019 at 2:16 AM Martin Cermak  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-().  This gives me a clear idea which
> > of my 9 desks (arranged as a 3x3 matrix) I am switching to.
> > Nothing visual involved.
>
> Thanks for the confirmation! I have the Ctrl-Alt-direction (or any other
> arbitrary key combination to change desktops) working perfectly: I
> should have been more clear on that. The thing I've not been able to
> accomplish is getting the pager to pop up when keys are pressed and
> then go away when those same keys are released.
>
> 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.nameor  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.

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.

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



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

2019-08-29 Thread Hegel3DReloaded
On Wednesday, 28. August 2019 17:03, Dave Weller-Fahy  
wrote:

> Greetings,
>
> I've search the website, archives, wiki, and a number of configuration
> websites, and have been unable to find a way to cause an action to
> happen when a modifier key is held down and/or released. I'm running
> fvwm 2.6.8 on CentOS 7.
>
> 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,
> but, if one wants, then holding Ctrl-Alt before pressing the 
> arrow key
> will pop up the pager so you can see the desks to which you will 
> be
> changing.

Hello,

I have too lasted for this feature at some point. Unfortunately, both Alt
and Ctrl are modifiers and by themselves cannot have a function. I was
thinking of calling IgnoreModifiers temporary in some function, but this
sentence in fvwm(1) man page disocouraged me: "If you issue it when your
fvwm session is already up and running the results are unpredictable."

But not all is lost - probably the closest match to this functionality is
the following setup which I currently use (purified <...> part of
configuration). Pager is configured under name/alias "LocalPager":

FvwmEvent (called as "Module FvwmEvent MainLoop") setup:

<...>
*MainLoop: new_desk f_ChangeDesk
*MainLoop: new_page f_ChangePage
<...>

DestroyFunc f_ChangePage
AddToFunc f_ChangePage
<...>
+ I Test (EnvMatch infostore.pageshowrootpager 1) f_ShowLocalPager
<...>

DestroyFunc f_ChangeDesk
AddToFunc f_ChangeDesk
+ I Test (EnvMatch infostore.pageshowrootpager 1) f_ShowLocalPager

DestroyFunc f_ShowLocalPager
AddToFunc f_ShowLocalPager
+ I Deschedule 131313
+ I All (Iconic, "LocalPager") State 0
+ I All (State 0, "LocalPager") Iconify off
+ I All (State 0, "LocalPager") Piperead "echo Move +$(( 
$[vp.width]/2-$[w.width]/2 ))p +5p"
+ I Schedule 1500 131313 All ("LocalPager", !HasPointer, !Iconic) Iconify on
+ I Schedule 3000 131313 All ("LocalPager", !HasPointer, !Iconic) Iconify on
+ I Schedule 5000 131313 All ("LocalPager", !HasPointer, !Iconic) Iconify on
+ I Schedule 8000 131313 All ("LocalPager", !HasPointer, !Iconic) Iconify on
+ I Schedule 1 131313 All ("LocalPager", !HasPointer, !Iconic) Iconify on
+ I All ("LocalPager") State 0 False

Now the keybindings part: when moving to another page or desk by ANY key
binding, LocalPager will popup on the screen (top center in my case) and
indicate where we are. If it doesn't get any attention, or it is left
alone after 3, 5, 8 or 10 seconds, it will dissapear. I'm using
Ctrl+(Up|Down|Left|Right) to move through pages of the current desk.

However, if Ctrl+Menu is pressed (which is close and handy to
Ctrl+cursor keys), Pager will move under the pointer for direct visual
selection with mouse, no matter if it is Iconic currently or not:

Silent Key Menu A C f_BringLocalPager

DestroyFunc f_BringLocalPager
AddToFunc f_BringLocalPager
+ I f_ShowLocalPager
+ I All (LocalPager) AnimatedMove m-5 m-6

One can even use my "double key binding" which has some Emacs-like feel,
and it prevents accidental activation while typing fast something. This
is a meta function, or "API" let's say.

# Execute what is in $1 - $X only a second time when
# function is called. Used to make double key bindings
# that will prevent accidental call while typing fast.
DestroyFunc f_DoubleBindKey
AddToFunc f_DoubleBindKey
+ I Test (EnvMatch infostore.dbk_$0 1) $[1-]
+ I Test (!EnvMatch infostore.dbk_$0 1) InfoStoreAdd dbk_$0 1
+ I Schedule 2000 InfoStoreRemove dbk_$0

That said, "Key Menu A C" can be than called as

f_DoubleBindKey loc_pager f_BringLocalPager

... where "loc_pager" is part for the short lived infostore variable
special only to this usage of the function.

Hope this helps a bit.


P. S.
You can find this and lot of other functions in My "NsCDE" project of FVWM-based
CDE on steroids on Github.



... one of the main causes of the fall of the Roman Empire
was that, lacking zero, they had no way to indicate
successful termination of their C programs.
  -- Robert Firth




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

2019-08-29 Thread Dave Weller-Fahy
On Thu, Aug 29, 2019 at 2:16 AM Martin Cermak  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-().  This gives me a clear idea which
> of my 9 desks (arranged as a 3x3 matrix) I am switching to.
> Nothing visual involved.

Thanks for the confirmation! I have the Ctrl-Alt-direction (or any other
arbitrary key combination to change desktops) working perfectly: I
should have been more clear on that. The thing I've not been able to
accomplish is getting the pager to pop up when keys are pressed and
then go away when those same keys are released.

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.

Regards,
  -dave