Re: FVWM: Canceling window placement via user-defined key

2018-12-30 Thread Dominik Vogt
On Sun, Dec 30, 2018 at 10:23:39AM -0700, Glenn Golden wrote:
> Dominik Vogt  [2018-12-30 01:11:13 +0100]:
> > On Sat, Dec 29, 2018 at 04:29:00PM -0700, Glenn Golden wrote:
> > > Anyway, the idiom I'm seeking to implement is this:
> > > 
> > > 1. Tap Control_R with pointer inside a window to begin 'Move' 
> > > operation
> > > 2. Use arrow keys to reposition the window
> > > 3. Tap Control_R to terminate the 'Move' operation
> > 
> > All the keyboard shortcuts for moving and resizing windows,
> > dragging the viewport and execution of complex functions are hard
> > coded in libs/Target.c.  I.e. this won't work without changing the
> > sources.
> > 
> 
> I'm not quite understanding what you mean, can you explain a little more?
> 
> The above already does work, by just binding Control_R to 'Move', except that
> the Move operation has to be terminated by 'Space' or 'Return'.  Do you mean
> that the definition of the terminating key events (i.e. Space or Return) is
> hardwired to those particular two keys in Target.c?

Exactly.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt



Re: FVWM: Canceling window placement via user-defined key

2018-12-30 Thread Glenn Golden
Dominik Vogt  [2018-12-30 01:11:13 +0100]:
> On Sat, Dec 29, 2018 at 04:29:00PM -0700, Glenn Golden wrote:
> > Anyway, the idiom I'm seeking to implement is this:
> > 
> > 1. Tap Control_R with pointer inside a window to begin 'Move' operation
> > 2. Use arrow keys to reposition the window
> > 3. Tap Control_R to terminate the 'Move' operation
> 
> All the keyboard shortcuts for moving and resizing windows,
> dragging the viewport and execution of complex functions are hard
> coded in libs/Target.c.  I.e. this won't work without changing the
> sources.
> 

I'm not quite understanding what you mean, can you explain a little more?

The above already does work, by just binding Control_R to 'Move', except that
the Move operation has to be terminated by 'Space' or 'Return'.  Do you mean
that the definition of the terminating key events (i.e. Space or Return) is
hardwired to those particular two keys in Target.c?



Re: FVWM: Canceling window placement via user-defined key

2018-12-29 Thread Dominik Vogt
On Sat, Dec 29, 2018 at 04:29:00PM -0700, Glenn Golden wrote:
> Anyway, the idiom I'm seeking to implement is this:
> 
> 1. Tap Control_R with pointer inside a window to begin 'Move' operation
> 2. Use arrow keys to reposition the window
> 3. Tap Control_R to terminate the 'Move' operation

All the keyboard shortcuts for moving and resizing windows,
dragging the viewport and execution of complex functions are hard
coded in libs/Target.c.  I.e. this won't work without changing the
sources.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt



Re: FVWM: Canceling window placement via user-defined key

2018-12-29 Thread Glenn Golden
Hi Elliot,

Thanks for your suggestions. (Replying to list since my original post may
have been confusing.)

elliot s  [2018-12-29 14:00:27 -0800]:
>
> I use Esc to kill moves in progress.
> 
> If key bindings can work while move in progress, maybe you can hit a
> key to remember old position and then hit it again to move window back.
>

Actually, what I meant by 'cancel placement' is to terminate the placement
operation, not to return the moved window to its original position.

It was my mistake to use the word 'cancel' rather than 'terminate' in my post,
because now that I read the fvwm man page more carefully, the way you have
interpreted 'cancel' -- returning the window to it's pre-moved position --
seems to be what the man page means too.  I didn't appreciate that when
I first read about CancelPlacement.

Anyway, the idiom I'm seeking to implement is this:

1. Tap Control_R with pointer inside a window to begin 'Move' operation
2. Use arrow keys to reposition the window
3. Tap Control_R to terminate the 'Move' operation

So Step 3 just leaves the window where it was when Control_R is tapped the
second time.

It's easy to implement the above with a trivial function and key binding,
but Step 3 is the problem: 

DestroyFunc MoveOrTerminateMove
AddToFunc   MoveOrTerminateMove
  + I ThisWindow (!State 6) Move
  + I ThisWindow ( State 6) <>
  + I State 6 toggle

Key Control_R W N MoveOrTerminateMove

The 'Return' and 'Spacebar' keys have built-in bindings that terminate
a Move operation, and they work fine.  But I'm lazy and would like to be
able to use Control_R instead, because on my keyboard, Control_R happens
to be located right next to the group of arrow keys. So this would allow
a handy and compact way to do small detailed repositionings mouselessly.