Simulate mouse click?

I’ve been trying in vain to have Python reverse direction of my Bezier path - the only solution available seems to use the interface. So I need to select the curve in question, enter edit mode, simulate pressing WKEY, then simulate a mouse click, exit edit mode. So far so good - but I have been unable to do mouse simulation yet. I don’t know what window type is the popup / lil menu that appears once you press WKEY:

It’s not receiving events for 3d viewport or scripts window. The code I’ve got so far:
viewWin = Window.GetScreenInfo(Window.Types.VIEW3D)[0]['id']
scriptWin = Window.GetScreenInfo(Window.Types.SCRIPT)[0]['id']
Window.QAdd(viewWin, Draw.WKEY, 1, 0)
Window.QAdd(scriptWin, Draw.LEFTMOUSE, 1, 1)
Window.QAdd(scriptWin, Draw.LEFTMOUSE, 0, 1)

Any ideas? :rolleyes:

Using the mouse is hard. AFAIK every menu item in Blender is numbered sequentially from its start. So to do ‘switch direction’ you could type ‘2’ instead of clicking.

What I don’t know is if that menu is blocking/stealing input. You may not be able to send input to it, or you may not be able to execute any instructions while it is open!

Theres no way of doing this in py at the moment (pressing on menu items)

Tried, and it is indeed stealing inputs. Ie. QAdd(viewWin, Draw.TWOKEY, 1, 1) only changes layers to layer 2 after I manually choose Switch Direction menu option.

So basically what you’re saying there is no way to switch curve direction in Python at all? In my previous thread I asked if it can be done - and was told that UI scripting is the only way. Now it turns out it’s not an option either… Ehh.