Vibrates the device for a specified duration.
Usage #
package main
import (
t "github.com/hugmouse/gotermux"
)
func main() {
vibration := t.TVibrate{
Duration: 1000, // 1 second
SilentModeIgnore: true, // Vibrate even in silent mode
}
t.TermuxVibrate(vibration)
}
Parameters #
t TVibrate
- Vibration configuration structure
Struct TVibrate #
Field | Type | Description |
---|---|---|
Duration | uint | Vibration duration in milliseconds |
SilentModeIgnore | bool | If true, vibrate even when device is silent |
The vibration duration is specified in milliseconds. For example, 1000 means 1 second of vibration.