Documentation ¶
Index ¶
- type Vector
- func (iv *Vector) Clear() *Vector
- func (iv *Vector) Contains(other *Vector) bool
- func (iv *Vector) Intersects(other *Vector) bool
- func (iv *Vector) SetKey(key constants.Key) *Vector
- func (iv *Vector) SetKeys(keys []constants.Key) *Vector
- func (iv *Vector) SetModifier(mod constants.Modifier) *Vector
- func (iv *Vector) SetModifiers(mods []constants.Modifier) *Vector
- func (iv *Vector) SetMouseButton(button constants.MouseButton) *Vector
- func (iv *Vector) SetMouseButtons(buttons []constants.MouseButton) *Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Vector ¶
type Vector struct { KeyVector *bitset.BitSet ModifierVector *bitset.BitSet MouseButtonVector *bitset.BitSet }
Vector represents the state of keys, modifiers, and mouse buttons. It can be used to compare input states, and is intended to be used as such:
- whatever manages system input keeps a "current" input vector and updates it
- things that are listening for certain inputs will be compared using `Contains` and `Intersects` methods
func (*Vector) Contains ¶
Contains returns true if this input vector is a superset of the given input vector
func (*Vector) Intersects ¶
Intersects returns true if this input vector shares any bits with the given input vector
func (*Vector) SetModifier ¶
SetModifier sets the corresponding modifier bit in the modifier bitset
func (*Vector) SetModifiers ¶
SetModifiers sets multiple modifier bits in the modifier bitset
func (*Vector) SetMouseButton ¶
func (iv *Vector) SetMouseButton(button constants.MouseButton) *Vector
SetMouseButton sets the corresponding mouse button bit in the mouse button bitset
func (*Vector) SetMouseButtons ¶
func (iv *Vector) SetMouseButtons(buttons []constants.MouseButton) *Vector
SetMouseButtons sets multiple mouse button bits in the mouse button bitset
Click to show internal directories.
Click to hide internal directories.