I'm trying to simulate double fn keypress on mac to start dictation so far i have read all the docs on SO and applied a few solutions, but all in vain. I'm trying to open dictation from python code. executed from terminal. So far i'have tried this but with no success.
from Quartz.CoreGraphics import CGEventCreateKeyboardEvent
from Quartz.CoreGraphics import CGEventPost
from Quartz.CoreGraphics import kCGHIDEventTap
evt = [CGEventCreateKeyboardEvent(None, 0x3f, True),
CGEventCreateKeyboardEvent(None, 0x3f, False),
CGEventCreateKeyboardEvent(None, 0x3f, True),
CGEventCreateKeyboardEvent(None, 0x3f, False)]
CGEventPost(kCGHIDEventTap, evt)
can anyone tell me where i'm going wrong ?