GithubHelp home page GithubHelp logo

Comments (14)

Vladimir-csp avatar Vladimir-csp commented on September 25, 2024

Above was not a full analog, that would require decoupling of modes from actions

<keybind key="W-p" >
    <action name="EnterKeybindMode" id="present" />
</keybind>

<!-- Title content is displayed on OSD while the mode is active -->
<keybind_mode id= "present" Title="Present:\n(m)irror\nset-(o)utput\nset-(r)egion\n(Shift) unset-(r)egion\nset-(s)caling\ntoggle-(f)reeze\n(c)ustom" >
    <keybind key="m">
      <action name="Execute" command="wl-present mirror" />
      <action name="ExitKeybindMode" />
    </keybind>
    <keybind key="o">
      <action name="Execute" command="wl-present set-output" />
      <action name="ExitKeybindMode" />
    </keybind>
    <keybind key="r">
      <action name="Execute" command="wl-present set-region" />
      <action name="ExitKeybindMode" />
    </keybind>
    <keybind key="S-r">
      <action name="Execute" command="wl-present unset-region" />
      <action name="ExitKeybindMode" />
    </keybind>
    <keybind key="s">
      <action name="Execute" command="wl-present set-scaling" />
      <action name="ExitKeybindMode" />
    </keybind>
    <keybind key="f">
      <action name="Execute" command="wl-present toggle-freeze" />
      <action name="ExitKeybindMode" />
    </keybind>
    <keybind key="c">
      <action name="Execute" command="wl-present custom" />
      <action name="ExitKeybindMode" />
    </keybind>
    <keybind key="Escape">
      <action name="ExitKeybindMode" />
    </keybind>
    <keybind key="Enter"
      <action name="ExitKeybindMode" />
    </keybind>
</keybind_mode>

from labwc.

johanmalm avatar johanmalm commented on September 25, 2024

Is this the Openbox equivalent of what you describe? http://openbox.org/wiki/Help:Bindings#Key_chains

from labwc.

Consolatis avatar Consolatis commented on September 25, 2024

This looks *very* complicated for a very niche use-case. And it reminds me more of emacs / vim rather than a stacking compositor / window manager.

from labwc.

Vladimir-csp avatar Vladimir-csp commented on September 25, 2024

Is this the Openbox equivalent of what you describe? http://openbox.org/wiki/Help:Bindings#Key_chains

Can't open openbox.org for some reason, but indirect references suggest this is at least something similar.

from labwc.

Vladimir-csp avatar Vladimir-csp commented on September 25, 2024

Is this the Openbox equivalent of what you describe? http://openbox.org/wiki/Help:Bindings#Key_chains

I've read it, yes this is extremely similar.

from labwc.

heroin-moose avatar heroin-moose commented on September 25, 2024

I second that, not having modes in labwc is meh. sway does extremely good job with nested keybindings. also yes, openbox had it ages ago :DDDDD

from labwc.

johanmalm avatar johanmalm commented on September 25, 2024

Let's go for it then πŸ˜„ I'm not opposed to it.
In term of writing code, I'm going to prioritize this stuff first: johanmalm/roadmap#1
But if anyone else wants to roll their sleeves up, then we're on.

from labwc.

Consolatis avatar Consolatis commented on September 25, 2024

Implementing key shortcuts for menu entries sounds way less intrusive and more flexible to me. It

  • provides the exact same feature as nested keybinds
  • allows to also select the sub actions via the mouse or up / down / enter keys and not only via the key shortcut
  • would support dynamic "keybind modes" via pipe menus
  • doesn't drastically make tracking the pressed key states more complicated compared to key chains / keybind modes

from labwc.

heroin-moose avatar heroin-moose commented on September 25, 2024

menu entries is somewhat different beast. usually people use that to separate window actions, for example. like Meta-r to enter resize mode and then meta+hjkl to set the direction.

from labwc.

Consolatis avatar Consolatis commented on September 25, 2024

Any examples where the menu based approach wouldn't work in comparison to a key mode based approach? I think it is actually way more flexible because you can nest however deep you want + have interactive control and well.. a visible menu.

from labwc.

heroin-moose avatar heroin-moose commented on September 25, 2024

Spawning a menu to resize the window? I believe it would violate the Principle of least astonishment, given that i3, sway and openbox have hierarchial keybindings implemented differently. Would it be a special menu for window? Should it be moved with a window? Where to place the menu if a hotkey is not related to a window? What to do if a menu contains hotkeys that operate on different objects (windows, desktops, etc)?

If someone wants a visual menu, he can use the existing facilities.

from labwc.

johanmalm avatar johanmalm commented on September 25, 2024

I’ve not yet pondered this much, but feel like carrying on the thought experiment.

With menu entry key shortcuts, a very similar set of code paths would exist compared to those required for nested keybinds.

How about if we added options to not show the menu, but rather just displaying the pressed key chain in an OSD (as openbox does for key chains).

It would then operate exactly like key chains, except that the user would have to define them as menus with an ID which they’d have to bind to a keybind.

Pro: shared code
Con: Unusual config syntax

from labwc.

heroin-moose avatar heroin-moose commented on September 25, 2024

IMO going through obscure config hacks will hurt in the long run.

from labwc.

johanmalm avatar johanmalm commented on September 25, 2024

IMO going through obscure config hacks will hurt in the long run.

I think you're right. Feels like we should implement it cleanly and independently (with Openbox style syntax http://openbox.org/wiki/Help:Bindings#Key_chains)

With server->input_mode I suspect it would be quite a straight forward implementation (famous last words!)

from labwc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.