FS#10575 - Simulator remote-control
|
DetailsThis patch enables you to control the simulator using a named pipe to provide simulated keypresses, rather than the keyboard.
Unfortunately there is a bug that means that not all events seem to have any effect. On the e200 sim, I can use the scroll buttons to move in the main menu, but neither RIGHT nor SELECT lets me enter any of the entries. I suspect it's related to repeat or hold/release handling, but I'm not sure how to fake that properly. |
BUTTON_REL must always be sent when a button is released (even after BUTTON_REPEAT).
It goes like this (select for example)
starting with the first tick
button released immediately
BUTTON_SELECT -> BUTTON_SELECT|BUTTON_REL
button is pressed for a short time, but not long enough for repeat:
BUTTON_SELECT -> BUTTON_SELECT -> BUTTON_SELECT -> BUTTON_SELECT|BUTTON_REL
Now longer, with repeat:
BUTTON_SELECT -> BUTTON_SELECT -> BUTTON_SELECT -> BUTTON_SELECT|BUTTON_REPEAT -> BUTTON_SELECT|BUTTON_REPEAT -> BUTTON_SELECT|BUTTON_REPEAT -> BUTTON_SELECT|BUTTON_REL
You need to fake that properly.
1) Post button status to the button status variable. This means plugins that do their own button handling work as well.
2) Attempt to add a STARTPLUGIN command. It does start the plugin, but behaviour is rather flaky. I suspect I'm not going about it the right way (launching the plugin from the wrong thread or something?). Plus there are 2 warnings caused by me not handling pointers right, I think.
load track -> play for 20 seconds -> skip backwards 5 seconds -> ...