Replies: 2 comments 1 reply
-
Very good! Do you want this published as contribution in the User Guide, as new section 17.7? (current 17.7 will then go as 17.8) True, pausing a script is no longer supported by Qt6. There were also very minor other changes caused by the Qt6 changeover, however I am glad we could keep scripting otherwise almost unchanged. Do you want to write more about scripting for users? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the scripts and detailed explanation. I found it very useful |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Long overdue, I was going to do these years ago, but life interfered and then pauseScript was implemented, then there was talk of the script language changing, so I never really finished.
But with Version 1, pauseScript apparently doesn’t work anymore and I see a few questions here and I am getting lots of emails from people who scripts now longer work and want to know how I am able to use keypresses in scripts.
So I decided to write some easy to understands scripts that are examples on how to use keypresses and a quick write up on how they work. Note, I'm not a technical writer, so be nice, but I hopefully made these scripts simple enough that it is easy enough to figure out
You can get them here
www.alienbasecamp.com/Stellarium/keypressscripts.zip
keypressscripts.zip
What do I mean by a keypress. For example, say you have a script of a series of astronomical events, instead of displaying them in set intervals (like display event, wait 10 seconds, display next event, wait 10 seconds, .. etc, etc.), can you instead give the user more control and pause the script after each event and have the script wait until the user presses a key to go on to the next event or go back (e.g Press "N" for next event, Press "B" to go back). Or suppose you want to give the user an option by pressing a key (e.g. Press "S" for Sun or "M" for Moon), can you do it?
The short answer is yes you can, however not directly, you have to use a "back-door / hack" way to get a keypress, albeit within limitations.
The trick is instead of having Stellarium "wait" for a key press, you instead use a "get" function and have Stellarium "watch" for the change in display which happens when you press that key. You just have to use a key and script "get" function that are related. These scripts should explain how to do it.
Good luck.
Beta Was this translation helpful? Give feedback.
All reactions