The _setMode() method was called, and just like at the beginning of this.mode = 0, this.realmode = 0, the algorithm in _setMode checks this.realmode != this.mode and only then calls setAnalogMode(), in which the mode is passed to the simulator.
When we find the DAL.CONN_NXT_DUMB sensor in detectDevices(), we additionally call setAnalogMode(). Perhaps the same thing needs to be done for DAL.CONN_INPUT_DUMB, but there is only one analog sensor ev3 (touch sensor), and it works without this change. This way you set the mode forcibly when the sensor is found, i.e. at the beginning.
I did the same thing as when finding DAL.CONN_INPUT_UART, in that case updateUartMode() is called.
The _setMode() method was called, and just like at the beginning of this.mode = 0, this.realmode = 0, the algorithm in _setMode checks this.realmode != this.mode and only then calls setAnalogMode(), in which the mode is passed to the simulator.
When we find the DAL.CONN_NXT_DUMB sensor in detectDevices(), we additionally call setAnalogMode(). Perhaps the same thing needs to be done for DAL.CONN_INPUT_DUMB, but there is only one analog sensor ev3 (touch sensor), and it works without this change. This way you set the mode forcibly when the sensor is found, i.e. at the beginning.
I did the same thing as when finding DAL.CONN_INPUT_UART, in that case updateUartMode() is called.