Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: pause hotkeys #321

Closed
Holdlang opened this issue May 26, 2023 · 5 comments
Closed

Feature Request: pause hotkeys #321

Holdlang opened this issue May 26, 2023 · 5 comments

Comments

@Holdlang
Copy link

Will would be really nice for example push Mouse5 to turn on/off other hotkeys.

@ParasiteDelta
Copy link
Contributor

Good news and bad news.

GWM uses the Windows API to define hotkeys, so unless it's recognized in the API or you bind M5 to a possible key or key combo, that's out of the question. There's a link in the README that leads you to a key list.

However, there is a thing called binding modes in GWM, allowing you to switch to a separate "mode" or "keybind palette" while that mode is active, so it could be as simple as mapping that to your M5 toggle. However, what would be the use case that requires you to disable GWM's hotkeys?

Here's an idea to try:

...
binding_modes:
- name: "freeze"
  keybindings:
    - command: "binding mode none"
      bindings: ["<WhateverKeybindYouChoose>"]
...
keybindings:
...
- command: "binding mode freeze"
    binding: "<WhateverKeybindYouChoose>"

@Holdlang
Copy link
Author

hi @ParasiteDelta !

thank you for your answer!
My use case would be to pause key bindings while I using VS Code or any other apps that has the same key combinations.

Will try the sollution that you mentioned.

Holdlang

@exic
Copy link

exic commented Oct 23, 2023

Just tried, works like a charm for me 😃
While in "freeze" mode, actually all other ("normal") bindings are deactivated – that wasn't clear to me before – so it does just what you want.

If you want your mouse to activate the freeze mode, you either have to use your mouse software to map your mouse button to <WhateverKeybindYouChoose> or maybe add an AutoHotKey mapping (that's at least what I did for some things I wanted on mouse buttons).

@ParasiteDelta
Copy link
Contributor

If you want a simple button to do so as well, there is a text Component that you can add to your bar so that you can toggle it with a mouse. For example:

...
bar:
   ...
   components_center:
      - type: "text"
        text: "Enable Pause Mode"
        left_click_command: "binding mode freeze"
        right_click_command: "binding mode none"

This Component has been a thing since 1.8, yet was apparently missed in the documentation, so it's fairly underutilized. Let me know if it works or if you have issues.

Also, for the actual mode assignment, you don't have to use bindings along with the square bracket assignment in binding_modes, you can just use binding and copy the command assignment from the keybindings section.

@lars-berger
Copy link
Member

alt+shift+p has been added to the default config for pausing keybindings until alt+shift+p is pressed again 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants