InfiniTimeOrg / InfiniSim

Simulator for InfiniTime user interface without needing a PineTime
GNU General Public License v3.0
164 stars 66 forks source link

Support launching an app/screen directly #112

Closed jackwilsdon closed 1 year ago

jackwilsdon commented 1 year ago

As the title says - it'd be good if an app/screen could be launched directly at startup. This would help improve the feedback loop whilst developing new features.

NeroBurner commented 1 year ago

This should be already possible as the number key already are bound to specific screens. Would Elit be enough for your usecase to programatically locally "rebind" one of the number keys?

NeroBurner commented 1 year ago

Closed due to inactivity

jackwilsdon commented 1 year ago

Apologies for the late reply on this. I didn't realise specific apps could be launched via the number keys - that's definitely useful. Is it possible to launch any apps after app 9? If not, it seems to me like a command line flag might still be useful (and would be useful for development anyway, allowing for launching straight into an app from the command line).

NeroBurner commented 1 year ago

You can add your app or replace one of the lower ones in the switch_to_screen helper function. A general switch wouldn't be feasible as we have more than 20 screens, and which ones do we select?

https://github.com/InfiniTimeOrg/InfiniSim/blob/main/main.cpp#L823

The switch to screen function was implement during the starting times of the simulator. Before I had implemented the screen switching and before all screens were able to compile 😁

jackwilsdon commented 1 year ago

A general switch wouldn't be feasible as we have more than 20 screens, and which ones do we select?

Unless I'm misunderstanding, what prevents a command line flag like -screen 9 being added? Having to refer to the screens by ID is not the most ideal, but it keeps it flexible (and means that a list of screen names isn't heeded).

NeroBurner commented 1 year ago

I'm sorry, I may am slow at the uptake here. Which screen would be launched by defining --screen 9? Could you describe what actions you would take in your scenario and what you would then expect to happen?