Sending an existing Qtile keybinding to another program using qtile.cmd_simulate_keypress() fails
See original GitHub issueI use a terminal (kitty) with tiling-like support and I’d like to reuse the same keybindings I use in Qtile with the kitty panes. However, Qtile has priority over the keybindings. I’ve managed to disable certain Qtile keybindings whenever a terminal window is focused using this minimal example:
def move_focus(qtile, direction):
if qtile.current_window.get_wm_class()[0] != 'kitty':
if direction == 'left':
qtile.current_group.layout.cmd_left()
else:
qtile.cmd_simulate_keypress([MOD], 'h')
keys = [Key([MOD], 'h', lazy.function(move_focus, direction='left'), desc='move focus left')]
However, the key combination still doesn’t get passed through to the terminal. How can I achieve that?
I’ve found other people with a similar issue:
- https://groups.google.com/g/qtile-dev/c/cp83eFM-JwQ
- https://groups.google.com/g/qtile-dev/c/e25bgej9Ses/m/pAczjD9lmEoJ
_Originally posted by @raj-magesh in https://github.com/qtile/qtile/discussions/3037_
EDIT:
Okay, going through old Qtile issues, the kitty
developer also raised this issue ~8 years ago: https://github.com/qtile/qtile/issues/324
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Default configuration's bindings do not work after a ... - GitHub
Hello, I'm having the same issue as @cr1ogen, just, no keybindings available when error in local config. I can interact with the bar ......
Read more >Keybindings in images - Qtile Docs
Generate your own images. Qtile provides a tiny helper script to generate keybindings images from a config file. In the repository, the script...
Read more >Keys — Qtile 0.1.dev50+g1c6a962.d20221218 documentation
Keys¶. The keys variable defines Qtile's key bindings. Individual key bindings are defined with Key as demonstrated in the following example.
Read more >Scripting Commands - Qtile Docs
Here is documented some of the commands available on objects in the command tree when running qtile shell or scripting commands to qtile....
Read more >Hacking on Qtile - Qtile Docs
Testing with the X11 backend requires Xephyr (and xvfb for headless mode) in addition to the core dependencies. Building cffi module¶. Qtile ships...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is indeed what #2925 is for, when that is merged we’re not completely there yet as actual swallowing based on a function’s execution is not implemented. However, #2925 supports swallowing based on the functions
.when(...)
check. We need to make a separate pr for more.when()
checks, such as thewm_class
or even arbitrarylazy.functions
so if that is merged in a separate pr you can define your keybinding as follows:If someone wants to take a look at supporting these custom
.when()
checks, the code needs to be added here. Maybe I will make a pr myself but I’m a bit busy with other issues and prs atm.No problem at all.
Help is always appreciated if you’re able (there’s help in the docs about how to collaborate if you need some tips) but don’t worry if you don’t have the time.
As you can see, the issue is being looked at so it should get resolved at some point!