You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[DynamicScript] Add property change signals for repeatingState and repeatCount; Move evaluate() to public API; Add setRepeating(); Rename enum MainExprDefault to LastExprDefault; Add and update documentation.
Copy file name to clipboardExpand all lines: src/DSE.h
+14-6Lines changed: 14 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -108,18 +108,26 @@ namespace DSE
108
108
109
109
//! The global default action repeat rate (interval), in milliseconds. The rate is the amount of time to wait between repeat activations a held action.
110
110
//! The repeat rate takes effect _after_ the initial repeat delay. Minimum interval is 50ms. \n
111
-
//! This property has a change notification event: `defaultActionRepeatRateChanged(int ms)`. A callback can be attached to this method by using the `connect()` syntax, eg:
111
+
//! This property has a change notification event: `defaultActionRepeatRateChanged(int ms)`.
112
+
//! A callback can be attached to, or detached from, this method by using the `connect()` and `disconnect()` syntax, eg:
//! The global default action repeat delay, in milliseconds. The delay is the amount of time before a held action starts repeating, after the initial activation.
119
123
//! After this initial delay, the action will be repeated at the current repeat rate. Minimum delay is 50ms.
120
-
//! This property has a change notification event: `defaultActionRepeatDelayChanged(int ms)`. A callback can be attached to this method by using the `connect()` syntax, eg:
124
+
//! This property has a change notification event: `defaultActionRepeatDelayChanged(int ms)`.
125
+
//! A callback can be attached to, or detached from, this method by using the `connect()` and `disconnect()` syntax, eg:
@@ -100,7 +100,7 @@ class DynamicScript : public QObject
100
100
//! to a settings file when DSE exits, and restored from settings the next time DSE starts. "Temporary" instances will be automatically deleted after a time span specified in \ref autoDeleteDelay.
//! When \ref persistence is of `DSE.PersistSave` type, this property value determines what happens when this instance is initially loaded from storage.
103
-
//! `DSE.SavedDefaultType` enumeration value, one of: `DSE.FixedValueDefault`, `DSE.CustomExprDefault`, `DSE.MainExprDefault`
103
+
//! `DSE.SavedDefaultType` enumeration value, one of: `DSE.FixedValueDefault`, `DSE.CustomExprDefault`, `DSE.LastExprDefault`
//! The default value specified for saved instance, if any. Depending on the value of \ref defaultType, this could be an empty string, a fixed default string value, or an expression to be evaluated.
@@ -185,15 +185,15 @@ class DynamicScript : public QObject
185
185
//! - `DSE.RepeatOnHold` - Ignores the initial button press and then starts repeating the evaluation after \ref effectiveRepeatDelay ms, until it is released.
186
186
//! - `DSE.OnRelease` - Evaluates expression only when button is released. This is the default behavior when using an action in Touch Portal's "On Pressed" button setup (which actually triggers actions upon button release).
//! The default action repeat rate for this particular instance, in milliseconds. If `-1` (default) then the global default rate is used. \sa activeRepeatRate, DSE.defaultActionRepeatRate
188
+
//! The default action repeat rate for this particular instance, in milliseconds. If `-1` (default) then the global default rate is used. \sa, activeRepeatRate, DSE.defaultActionRepeatRate, repeatRateChanged()
//! The default action repeat delay for this particular instance, in milliseconds. If `-1` (default) then the global default rate is used. \sa activeRepeatDelay, DSE.defaultActionRepeatDelay
190
+
//! The default action repeat delay for this particular instance, in milliseconds. If `-1` (default) then the global default rate is used. \sa activeRepeatDelay, DSE.defaultActionRepeatDelay, repeatDelayChanged()
//! The action repeat rate for the _currently repeating_ script action, in milliseconds. Changes to this value are only relevant while an action is actively repeating (\ref isRepeating == `true`).
193
-
//! If `-1` (default) then \ref repeatRate or the global default rate is used.
193
+
//! If `-1` (default) then \ref repeatRate or the global default rate is used. \sa activeRepeatRateChanged()
//! The action repeat delay time for the _currently repeating_ script action, in milliseconds. Changes to this value are only relevant while an action is actively repeating (\ref isRepeating == `true`).
196
-
//! If `-1` (default) then \ref repeatDelay or the global default delay is used.
196
+
//! If `-1` (default) then \ref repeatDelay or the global default delay is used. \sa activeRepeatDelayChanged()
//! The currently effective action repeat rate which is either the global default rate, or this instance's \ref repeatRate if set, or \ref activeRepeatRate if it was set and \ref isRepeating is `true`.
199
199
//! \n This property is read-only.
@@ -203,12 +203,19 @@ class DynamicScript : public QObject
//! Get or set the maximum number of times this action will repeat when held. A value of `-1` (default) means to repeat an unlimited number of times. Setting the value to `0` effectively disables repeating.
//! The number of times the current, or last, repeating action of this instance has repeated. The property is reset to zero when the action if first invoked.
206
+
//! The number of times the current, or last, repeating action of this instance has repeated. The property is reset to zero when the \ref isRepeating property changes
207
+
//! from `false` to `true` -- that is, every time the repetition is about to start, but before the initial \ref effectiveRepeatDelay time has passed. \sa repeatCountChanged(), isRepeating, isPressed
//! `true` if this script evaluation is currently repeating, `false` otherwise.
211
+
//! The value changes to `true` every time the repetition is about to start, but before the initial \ref effectiveRepeatDelay time has passed.
212
+
//! For example it is possible to cancel a repitition before it even starts by setting \ref isPressed to `false` whenever whenever this property changes. \sa repeatingStateChanged()
0 commit comments