Mirrored keybindings with mirrored layout

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Mirrored keybindings with mirrored layout

Andreas Doll
Hello

I use the ResizableTall layout and configured key bindings for resizing
windows which resemble vim movements:

    ("M-S-j",   sendMessage MirrorShrink)
    ("M-S-k",   sendMessage MirrorExpand)
    ("M-S-h",   sendMessage Shrink)
    ("M-S-l",   sendMessage Expand)
 
Now when I use a mirrored variant of this layout, the key bindings are
mirrored as well - meaning that j/k change the window size horizontally and
h/k vertically.

Is it possible to keep the original behaviour also in the mirrored layout variant?

Best regards,
Andreas
_______________________________________________
xmonad mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
Reply | Threaded
Open this post in threaded view
|

Re: Mirrored keybindings with mirrored layout

Adam Vogt
Hi Andreas,

You could check the layout description of the current layout for "Mirror" (or something else if you're using XMonad.Layout.Named), and then have the key binding send the message that makes more sense for the given layout.

This is probably a good start that compiles but I didn't test it <http://lpaste.net/8970541507006169088>.

Cheers,
Adam

On Mon, Apr 11, 2016 at 10:20 AM, Andreas Doll <[hidden email]> wrote:
Hello

I use the ResizableTall layout and configured key bindings for resizing
windows which resemble vim movements:

    ("M-S-j",   sendMessage MirrorShrink)
    ("M-S-k",   sendMessage MirrorExpand)
    ("M-S-h",   sendMessage Shrink)
    ("M-S-l",   sendMessage Expand)

Now when I use a mirrored variant of this layout, the key bindings are
mirrored as well - meaning that j/k change the window size horizontally and
h/k vertically.

Is it possible to keep the original behaviour also in the mirrored layout variant?

Best regards,
Andreas
_______________________________________________
xmonad mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad


_______________________________________________
xmonad mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
Reply | Threaded
Open this post in threaded view
|

Re: Mirrored keybindings with mirrored layout

Andreas Doll
On 2016-04-11 at 14:26, adam vogt wrote:
> You could check the layout description of the current layout for "Mirror" (or
> something else if you're using XMonad.Layout.Named), and then have the key
> binding send the message that makes more sense for the given layout.

> This is probably a good start that compiles but I didn't test it <http://
> lpaste.net/8970541507006169088>.

Thanks! In flipD I have to use U -> L, D -> R, besides that it works like a
charm.

Best regards,
Andreas
_______________________________________________
xmonad mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad