I am making a script that remaps a single key (right-ctrl) into alt+tab using the Python library known as keyboard. This was easy to do with Autohotkey on windows, however, this doesn't seem to be possible on Linux. After all in the keyboard documentation they have funcion(param, param, Suppress=False), so it should work right?
import keyboard
def altTab:
keyboard.release(97)
keyboard.send("alt+tab")
# 97 is the key_code for [right ctrl] on my system
keyboard.on_press_key(97, altTab, suppress=True)
I've tried releasing the key from the code standpoint but it doesn't seem to work, as ctrl+alt+tab is different from alt+tab. I have also tried using the keyboard.remap_key function to change right ctrl into right alt, and right alt into left alt so that right alt would work, then sending just tab instead of alt+tab but it still doesn't work. I am using Ubuntu Linux.
Please help, I'm stumped