Toggle screen recording with AutoKey and vokoscreenNG

| geek

I want to be able to toggle recording with a keypress, but vokoscreen-ng didn't seem to have a shortcut for that. Autokey to the rescue! At first I tried to send <ctrl><shift><f10> directly, but that didn't work because I had to fake the keypresses. Here's the working script:

from subprocess import call
keyboard.press_key("<ctrl>")
keyboard.press_key("<shift>")
if not store.has_key('voko-running'):
    store.set_value('voko-running', 1)
    keyboard.fake_keypress('<f10>')
else:
    store.remove_value('voko-running')
    keyboard.fake_keypress('<f11>')
keyboard.release_key("<ctrl>")
keyboard.release_key("<shift>")

I've bound it to my Menu key. Let's see if that makes things easier.

You can comment with Disqus or you can e-mail me at sacha@sachachua.com.