You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Without having i3-focus-last installed (yes, not the ideal way for opening first issue, but most apps have this problem, which I will mention now), I want to ask about the ALT key release behavior.
So, in my opinion, after an ALT+Tab is detected, the MRU should only be committed after the ALT key has been released. I found this to be a working solution for that (Key-up detection without interfering with other processes):
#!/usr/bin/env python3
import asyncio
from evdev import InputDevice, ecodes, list_devices
async def monitor_key_events():
# Find the keyboard device
devices = [InputDevice(path) for path in list_devices()]
keyboard_device = None
for device in devices:
if "keyboard" in device.name.lower():
keyboard_device = device
break
if not keyboard_device:
print("Keyboard device not found")
return
print(f"Monitoring key events on {keyboard_device.name}")
# Monitor key events
async def read_events(device):
while True:
event = await device.async_read_one()
yield event
async for event in read_events(keyboard_device):
if event.type == ecodes.EV_KEY:
if event.code == ecodes.KEY_LEFTMETA:
if event.value == 0: # Key release
print("Left WIN key released!")
async def main():
task = asyncio.create_task(monitor_key_events())
await task
if __name__ == "__main__":
asyncio.run(main())
With this approach, you can detect the ALT key being released, even when i3 is binding that key, and the key is not "grabbed" or the key event is not stolen.
I apologize for not writing a clear issue, but I only wanted to share some thoughts/issues that I came across during my research over the past few days.
By the way, the Rofi plugin idea could be exactly the right direction. Do you also display the workspace number and process names (+ window title) as in Rofi window mode?
The text was updated successfully, but these errors were encountered:
For the first point, I only use the simple Alt-Tab functionality as toggle, not full cycle through history as usually rofi is a better fit for that. So I've never considered it so far. The tool also supports sway on wayland, so I think the keyboard monitoring approach would not quite work. Using a timeout could be a possible but I would prefer it to be a client flag instead of a global server behavior.
Without having i3-focus-last installed (yes, not the ideal way for opening first issue, but most apps have this problem, which I will mention now), I want to ask about the ALT key release behavior.
Most implementations of similar software simply ignore the ALT key release for accepting the new MRU list. For example, https://github.com/altdesktop/i3ipc-python/blob/master/examples/i3-cycle-focus.py uses a delay as a workaround.
So, in my opinion, after an ALT+Tab is detected, the MRU should only be committed after the ALT key has been released. I found this to be a working solution for that (Key-up detection without interfering with other processes):
With this approach, you can detect the ALT key being released, even when i3 is binding that key, and the key is not "grabbed" or the key event is not stolen.
I apologize for not writing a clear issue, but I only wanted to share some thoughts/issues that I came across during my research over the past few days.
By the way, the Rofi plugin idea could be exactly the right direction. Do you also display the workspace number and process names (+ window title) as in Rofi window mode?
The text was updated successfully, but these errors were encountered: