Re: FVWM: how to escape F1?

2019-03-08 Thread Jaimos Skriletz
On Fri, Mar 8, 2019 at 10:17 AM Stefan Klinger  wrote:
>
> Hi,
>
> this is an *untested* idea: There's `FakeKeypress` documented in
> fvwm(1), which seems to send a keypress event to an application.  I
> assume, that for each binding you have in yout setup, like
>

Many apps do not like FakeKeyPress, so it is probably not an
appropriate way to try to 'escape' a keybinding, since many apps will
just ignore fake events anyways. The options already listed in this
thread are most likely the better approaches.

1) Write a custom function that turns keybindings on/off, then you can
use that to escape the binding by turning it off, then you can run the
function again to turn it back on.

2) Use a modifier on the key bindings, so F1 isn't a key binding
anymore, this way F1 can pass to the applications just fine.

jaimos



Re: FVWM: how to escape F1?

2019-03-08 Thread Stefan Klinger
Hi,

this is an *untested* idea: There's `FakeKeypress` documented in
fvwm(1), which seems to send a keypress event to an application.  I
assume, that for each binding you have in yout setup, like

Key

you would have to add something like

KeyFakeKeypress \
press  press  release  release 

to make myEscModifier-myEscKey escape key from FVWM and send it to the
client instead.

But the documentation about how `release` relates to `press` is a bit
thin, and the manual explicitly states that this may ot work at all.

I have no further knowledge about this, never used it.

For me, I've decided to control all window manager interactions with
mod4 bound to the logo keys, and the menu-key (next to the tight Ctrl
on US keyboards).  These are usually not used by applications.

Cheers
Stefan


-- 
http://stefan-klinger.deo/X
I prefer receiving plain text messages, not exceeding 32kB. /\/
  \



Re: FVWM: how to escape F1?

2019-03-08 Thread Stephen Dennison
On Fri, Mar 8, 2019 at 6:06 AM Dominik Vogt  wrote:
>
> On Fri, Mar 08, 2019 at 10:59:44AM +0100, Harald Dunkel wrote:
> > Hi Thomas,
> >
> > On 3/8/19 9:53 AM, Thomas Adam wrote:
> > > Key F1 A A --
> > >
> >
> > Apparently thats a misunderstanding. Sorry for my bad English.
> >
> > I would like fvwm to *ignore all key bindings for one keypress*
> > to forward it directly to the app with input focus.
>
> X11 does not have a way to override all grabs for just a couple of
> keystrokes.  If a grab is present, it's always active.  (Unless
> the application grabs the keyboard, but that is not what you're
> looking for.)
>
> So the only way to do that is to put all key bindings in some
> file or function, e.g.
>
>   bind_keys
>
> and to unbind them in another one
>
>   unbind_keys
>
> then "read unbind_keys" when necessary and restore them with "read
> bind_keys" later.  You'll probably be unhappy with the performance
> of this approach if you have mora than just a few bindings.
> (Don't forget to put a binding that reactivates the other bindings
> into unbind_keys.)
>
> > Some kind of
> > "escape" key entered before the actual key.
> >
> > For example, I have
> >
> >   Key F1 A N Switch-Iconic
> >   Key F2 ...
> >   :
> >
> > in my .fvwmrc.
> >
> > Assuming the window "xyz" has input focus: If I press and release
> > some [magic_escape_key], followed by [F1], then "xyz" should *not*
> > be changed to an icon, but [F1] should be sent to "xyz" instead.
>
> Ciao
>
> Dominik ^_^  ^_^
>
> --
>
> Dominik Vogt
>

Perhaps I'm misunderstanding the request, but you could also just use a
modifier like the num lock key.  As long as you are *not* ignorning modifiers,
you can press numlock and then the key presses will all go to applications and
fvwm will ignore them.  Then when you want fvwm to pay attention again, just
turn off numlock.

I use this a lot when using nested x sessions to control which window manager
gets a key press.  It works very well.



Re: FVWM: how to escape F1?

2019-03-08 Thread Dominik Vogt
On Fri, Mar 08, 2019 at 10:59:44AM +0100, Harald Dunkel wrote:
> Hi Thomas,
> 
> On 3/8/19 9:53 AM, Thomas Adam wrote:
> > Key F1 A A --
> > 
> 
> Apparently thats a misunderstanding. Sorry for my bad English.
> 
> I would like fvwm to *ignore all key bindings for one keypress*
> to forward it directly to the app with input focus.

X11 does not have a way to override all grabs for just a couple of
keystrokes.  If a grab is present, it's always active.  (Unless
the application grabs the keyboard, but that is not what you're
looking for.)

So the only way to do that is to put all key bindings in some
file or function, e.g.

  bind_keys

and to unbind them in another one

  unbind_keys

then "read unbind_keys" when necessary and restore them with "read
bind_keys" later.  You'll probably be unhappy with the performance
of this approach if you have mora than just a few bindings.
(Don't forget to put a binding that reactivates the other bindings
into unbind_keys.)

> Some kind of
> "escape" key entered before the actual key.
> 
> For example, I have
> 
>   Key F1 A N Switch-Iconic
>   Key F2 ...
>   :
> 
> in my .fvwmrc.
> 
> Assuming the window "xyz" has input focus: If I press and release
> some [magic_escape_key], followed by [F1], then "xyz" should *not*
> be changed to an icon, but [F1] should be sent to "xyz" instead.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt



FVWM: how to escape F1?

2019-03-08 Thread Harald Dunkel

Hi folks,

I have defined several function keys for fvwm, but sometimes I
would like to send F1 (for example) to the app running in the
window, bypassing fvwm's function bound to it.

Is there some hidden function to temporarily disable the
Key bindings to forward *any* key combination to the window
with input focus?

Hopefully I wasn't too blind to see. Every helpful comment is
highly appreciated.


Regards
Harri