45 lines
1.9 KiB
Go
45 lines
1.9 KiB
Go
// Package config stores common configuration parameters. They are unmanaged,
|
|
// and do not broadcast events when changed. Thus, they must be queried each
|
|
// time they are used, whether that be by backends, applications, or objects.
|
|
// They are intended to be set by things like application frameworks. Values set
|
|
// by other things are subject to being overridden.
|
|
package config
|
|
|
|
import "time"
|
|
import "git.tebibyte.media/tomo/tomo/input"
|
|
|
|
// DoubleClickDelay is the maximum amount of time that can pass between two
|
|
// consecutive clicks for them to be considered a double-click.
|
|
var DoubleClickDelay time.Duration = time.Second
|
|
|
|
// ScrollSpeed is how many units (pixels at a scale of 1.0) the content of a
|
|
// ContentBox should be moved in response to a scroll delta of 1.0.
|
|
var ScrollSpeed int = 16
|
|
|
|
// KeyChordConfirm is used to activate focused objects, and commonly to signal
|
|
// to the application that the user wishes to submit a value they have entered
|
|
// using the keyboard into an input field.
|
|
var KeyChordConfirm = input.KC(input.KeyEnter, input.ModNone)
|
|
|
|
// KeyChordClose is used to break out of some mode or state, such as a modal
|
|
// dialog.
|
|
var KeyChordClose = input.KC(input.KeyEscape, input.ModNone)
|
|
|
|
// KeyChordFocusNext is used to advance the input focus to the next focusable
|
|
// object.
|
|
var KeyChordFocusNext = input.KC(input.KeyTab, input.ModNone)
|
|
|
|
// KeyChordFocusPrevious is used to advance the input focus to the previous
|
|
// focusable object.
|
|
var KeyChordFocusPrevious = input.KC(input.KeyTab, input.ModShift)
|
|
|
|
// ButtonChordInteract is used to select, activate, and drag objects.
|
|
var ButtonChordInteract = input.BC(input.ButtonLeft, input.ModNone)
|
|
|
|
// ButtonChordContextMenu is used to open a context menu on an object.
|
|
var ButtonChordContextMenu = input.BC(input.ButtonRight, input.ModNone)
|
|
|
|
// ButtonChordPan is used to move the content of a content object relative to
|
|
// its inner bounds.
|
|
var ButtonChordPan = input.BC(input.ButtonMiddle, input.ModNone)
|