HowTo:ScriptKeyPresses

From S2PLOT

(Difference between revisions)
Jump to: navigation, search
Revision as of 05:36, 19 February 2008
Dbarnes (Talk | contribs)
(How to "script" key presses for S2PLOT)
← Previous diff
Current revision
Dbarnes (Talk | contribs)
(How to "script" key presses for S2PLOT)
Line 6: Line 6:
* Lines beginning with a hash "#" are comment lines and are ignored. * Lines beginning with a hash "#" are comment lines and are ignored.
-* Lines of the format "k time keys" where time is a floating point value in seconds indicating the time at which "keys" should be simulated as pressed. "keys" is a list of standard keyboard characters, including alphanumeric characters, space and punctuation characters.+* Lines of the format "k time keys" where time is a floating point value in seconds indicating the time at which "keys" should be simulated as pressed. "keys" is a list of standard keyboard characters, including alphanumeric characters, space and punctuation characters. The "k" prefix indicates this is a key press event.
The "time" value can be negative. In this case, all keypreses with negative times are "pressed" before the first frame is generated. This is one way to initialise the visualisation to a particular state, depending on the individual S2PLOT program. The "time" value can be negative. In this case, all keypreses with negative times are "pressed" before the first frame is generated. This is one way to initialise the visualisation to a particular state, depending on the individual S2PLOT program.
This system will be enhanced in the future. A current and serious limitation is that anything which effects the rendering speed of the program (eg. slower/faster graphics card / computer; saving frames for a movie; ...) will affect the progress through the animation and change the number of frames between key events. This system will be enhanced in the future. A current and serious limitation is that anything which effects the rendering speed of the program (eg. slower/faster graphics card / computer; saving frames for a movie; ...) will affect the progress through the animation and change the number of frames between key events.

Current revision

How to "script" key presses for S2PLOT

S2PLOT provides a very basic mechanism for "scripting" key presses.

The environment variable S2PLOT_EVENTFILE can be used to name a file whose lines are of the format:

  • Lines beginning with a hash "#" are comment lines and are ignored.
  • Lines of the format "k time keys" where time is a floating point value in seconds indicating the time at which "keys" should be simulated as pressed. "keys" is a list of standard keyboard characters, including alphanumeric characters, space and punctuation characters. The "k" prefix indicates this is a key press event.

The "time" value can be negative. In this case, all keypreses with negative times are "pressed" before the first frame is generated. This is one way to initialise the visualisation to a particular state, depending on the individual S2PLOT program.

This system will be enhanced in the future. A current and serious limitation is that anything which effects the rendering speed of the program (eg. slower/faster graphics card / computer; saving frames for a movie; ...) will affect the progress through the animation and change the number of frames between key events.

Personal tools