Pykeyboard to activate Push-to-Talk in Mumble
Posted: Sun Mar 02, 2014 8:58 am
Hi,
I'm trying to control different Mumble shortcuts (PTT, Volume up/down etc) from GPIO switches, I have CRTL_L+1 to activate Push-to-Talk but nothing happens with the code below. If I change it to send ALT+o it opens the Configure menu so it targets the right window but does not activate Mumble user set shortcuts.
Any ideas on what I could try next?
I'm trying to control different Mumble shortcuts (PTT, Volume up/down etc) from GPIO switches, I have CRTL_L+1 to activate Push-to-Talk but nothing happens with the code below. If I change it to send ALT+o it opens the Configure menu so it targets the right window but does not activate Mumble user set shortcuts.
Code: Select all
import subprocess, os, time, pykeyboard
os.environ['DISPLAY'] = ':0.0'
subprocess.Popen('XAUTHORITY=/home/pi/.Xauthority DISPLAY=:0 /usr/bin/xdotool search --onlyvisible --name Mumble windowactivate', shell=True)
k = pykeyboard.PyKeyboard()
k.press_key(k.control_l_key)
k.press_key('1')
time.sleep(2)
k.release_key('1')
k.release_key(k.control_l_key)