For speech rate in settings up/down move by 10, left/right move by 1. Easier to get settings right without having to hold doown the arrow keys lol.

This commit is contained in:
Storm Dragon committed 2026-10-28 15:44:41 -04:00
1 parent ea5d26f56d
commit 088f706cb4
13 files changed
+81 -10

No files matched your search

+10 -2
View File
@@ -54,6 +54,14 @@ func New_session(form Form) (*Session, error) {
return nil, fmt.Errorf("invalid control %q", control.ID)
}
controlIDs[control.ID] = true
if control.Kind == Number {
if control.UpDownStep == 0 {
control.UpDownStep = 1
}
if math.IsNaN(control.UpDownStep) || math.IsInf(control.UpDownStep, 0) || control.UpDownStep < 0 {
return nil, fmt.Errorf("invalid vertical step %q", control.ID)
}
}
if control.Kind == Number && (math.IsNaN(control.Number) || math.IsInf(control.Number, 0) || math.IsNaN(control.Min) || math.IsInf(control.Min, 0) || math.IsNaN(control.Max) || math.IsInf(control.Max, 0) || math.IsNaN(control.Step) || math.IsInf(control.Step, 0) || control.Min > control.Max || control.Step <= 0 || control.Number < control.Min || control.Number > control.Max) {
return nil, fmt.Errorf("invalid range %q", control.ID)
}
@@ -244,9 +252,9 @@ func (s *Session) Handle(key Key) Result {
delta := 0.0
switch key.Name {
case "up":
delta = 1
delta = control.UpDownStep
case "down":
delta = -1
delta = -control.UpDownStep
case "right":
delta = control.Step
case "left":