dxinput

package
v0.0.0-...-17244d7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// see also randr
	RotationDirectionNormal   uint8 = 1
	RotationDirectionLeft           = 2
	RotationDirectionInverted       = 4
	RotationDirectionRight          = 8
)
View Source
const (
	WacomTypeUnknown = iota
	WacomTypeStylus
	WacomTypeEraser
	WacomTypePad
)

Variables

This section is empty.

Functions

func SetKeyboardRepeat

func SetKeyboardRepeat(enabled bool, delay, interval uint32) error

Types

type Mouse

type Mouse struct {
	Id         int32
	Name       string
	TrackPoint bool
	// contains filtered or unexported fields
}

func NewMouse

func NewMouse(id int32) (*Mouse, error)

func NewMouseFromDeviceInfo

func NewMouseFromDeviceInfo(dev *utils.DeviceInfo) (*Mouse, error)

func (*Mouse) CanChangeAccelProfile

func (m *Mouse) CanChangeAccelProfile() bool

blumia: currently only allow config accel profile when using libinput TODO: Evdev support ref: http://510x.se/notes/posts/Changing_mouse_acceleration_in_Debian_and_Linux_in_general/

func (*Mouse) CanLeftHanded

func (m *Mouse) CanLeftHanded() bool

func (*Mouse) CanMiddleButtonEmulation

func (m *Mouse) CanMiddleButtonEmulation() bool

func (*Mouse) CanNaturalScroll

func (m *Mouse) CanNaturalScroll() bool

func (*Mouse) CanWheelEmulation

func (m *Mouse) CanWheelEmulation() bool

func (*Mouse) CanWheelHorizNaturalScroll

func (m *Mouse) CanWheelHorizNaturalScroll() bool

func (*Mouse) CanWheelHorizScroll

func (m *Mouse) CanWheelHorizScroll() bool

func (*Mouse) Enable

func (m *Mouse) Enable(enabled bool) error

func (*Mouse) EnableLeftHanded

func (m *Mouse) EnableLeftHanded(enabled bool) error

func (*Mouse) EnableMiddleButtonEmulation

func (m *Mouse) EnableMiddleButtonEmulation(enabled bool) error

EnableMiddleButtonEmulation enable mouse middle button emulation "Evdev Middle Button Emulation"

1 boolean value (8 bit, 0 or 1).

func (*Mouse) EnableNaturalScroll

func (m *Mouse) EnableNaturalScroll(enabled bool) error

func (*Mouse) EnableWheelEmulation

func (m *Mouse) EnableWheelEmulation(enabled bool) error

EnableWheelEmulation enable mouse wheel emulation "Evdev Wheel Emulation"

1 boolean value (8 bit, 0 or 1).

func (*Mouse) EnableWheelHorizNaturalScroll

func (m *Mouse) EnableWheelHorizNaturalScroll(enabled bool) error

func (*Mouse) EnableWheelHorizScroll

func (m *Mouse) EnableWheelHorizScroll(enabled bool) error

func (*Mouse) IsAdaptiveAccelProfileEnabled

func (m *Mouse) IsAdaptiveAccelProfileEnabled() bool

func (*Mouse) IsEnabled

func (m *Mouse) IsEnabled() bool

func (*Mouse) MiddleButtonEmulationTimeout

func (m *Mouse) MiddleButtonEmulationTimeout() (int16, error)

func (*Mouse) MotionAcceleration

func (m *Mouse) MotionAcceleration() (float32, error)

func (*Mouse) MotionScaling

func (m *Mouse) MotionScaling() (float32, error)

func (*Mouse) MotionThreshold

func (m *Mouse) MotionThreshold() (float32, error)

func (*Mouse) SetMiddleButtonEmulationTimeout

func (m *Mouse) SetMiddleButtonEmulationTimeout(timeout int16) error

SetMiddleButtonEmulationTimeout set middle button emulation timeout "Evdev Middle Button Timeout"

1 16-bit positive value.

func (*Mouse) SetMotionAcceleration

func (m *Mouse) SetMotionAcceleration(accel float32) error

func (*Mouse) SetMotionScaling

func (m *Mouse) SetMotionScaling(scaling float32) error

func (*Mouse) SetMotionThreshold

func (m *Mouse) SetMotionThreshold(thres float32) error

func (*Mouse) SetRotation

func (m *Mouse) SetRotation(direction uint8) error

func (*Mouse) SetUseAdaptiveAccelProfile

func (m *Mouse) SetUseAdaptiveAccelProfile(useAdaptiveProfile bool) error

Set to false to use flat accel profile

func (*Mouse) SetWheelEmulationButton

func (m *Mouse) SetWheelEmulationButton(btnNum int8) error

SetWheelEmulationButton set wheel emulation button "Evdev Wheel Emulation Button"

1 8-bit value, allowed range 0-32, 0 disables the button.

func (*Mouse) SetWheelEmulationTimeout

func (m *Mouse) SetWheelEmulationTimeout(timeout int16) error

SetWheelEmulationTimeout set wheel emulation timeout "Evdev Wheel Emulation Timeout"

1 16-bit positive value.

func (*Mouse) WheelEmulationButton

func (m *Mouse) WheelEmulationButton() (int8, error)

func (*Mouse) WheelEmulationTimeout

func (m *Mouse) WheelEmulationTimeout() (int16, error)

type Touchpad

type Touchpad struct {
	Id   int32
	Name string
	// contains filtered or unexported fields
}

func NewTouchpad

func NewTouchpad(id int32) (*Touchpad, error)

*

func NewTouchpadFromDevInfo

func NewTouchpadFromDevInfo(dev *utils.DeviceInfo) (*Touchpad, error)

func (*Touchpad) CanDisableWhileTyping

func (tpad *Touchpad) CanDisableWhileTyping() bool

func (*Touchpad) CanEdgeScroll

func (tpad *Touchpad) CanEdgeScroll() bool

func (*Touchpad) CanLeftHanded

func (tpad *Touchpad) CanLeftHanded() bool

func (*Touchpad) CanNaturalScroll

func (tpad *Touchpad) CanNaturalScroll() bool

func (*Touchpad) CanPalmDetect

func (tpad *Touchpad) CanPalmDetect() bool

func (*Touchpad) CanTapToClick

func (tpad *Touchpad) CanTapToClick() bool

func (*Touchpad) CanTwoFingerScroll

func (tpad *Touchpad) CanTwoFingerScroll() (bool, bool)

func (*Touchpad) Enable

func (tpad *Touchpad) Enable(enabled bool) error

*

  • Property 'Synaptics Off' 8 bit, valid values (0, 1, 2):
  • Value 0: Touchpad is enabled
  • Value 1: Touchpad is switched off
  • Value 2: Only tapping and scrolling is switched off *

func (*Touchpad) EnableDisableWhileTyping

func (tpad *Touchpad) EnableDisableWhileTyping(enabled bool) error

func (*Touchpad) EnableEdgeScroll

func (tpad *Touchpad) EnableEdgeScroll(enabled bool) error

*

  • Property "Synaptics Edge Scrolling" 8 bit (BOOL), 3 values, vertical,
  • horizontal, corner. :
  • Option "VertEdgeScroll" "boolean":
  • Enable vertical scrolling when dragging along the right edge.
  • Option "HorizEdgeScroll" "boolean" :
  • Enable horizontal scrolling when dragging along
  • the bottom edge.
  • Option "CornerCoasting" "boolean":
  • Enable edge scrolling to continue while the finger stays
  • in an edge corner. *

func (*Touchpad) EnableLeftHanded

func (tpad *Touchpad) EnableLeftHanded(enabled bool) error

func (*Touchpad) EnableNaturalScroll

func (tpad *Touchpad) EnableNaturalScroll(enabled bool) error

*

  • Property "Synaptics Scrolling Distance" 32 bit, 2 values, vert, horiz.
  • Option "VertScrollDelta" "integer":
  • Move distance of the finger for a scroll event.
  • Option "HorizScrollDelta" "integer" :
  • Move distance of the finger for a scroll event. *
  • if delta = 0, use value from property getting *

func (*Touchpad) EnablePalmDetect

func (tpad *Touchpad) EnablePalmDetect(enabled bool) error

EnablePalmDetect set synaptics palm detect 'Synaptics Palm Detection' 8 bit (BOOL)

func (*Touchpad) EnableTapToClick

func (tpad *Touchpad) EnableTapToClick(enabled bool) error

*

  • Property 'Synaptics Tap Action' 8 bit,
  • up to MAX_TAP values (see synaptics.h), 0 disables an element.
  • order: RT, RB, LT, LB, F1, F2, F3.
  • Option "RTCornerButton" "integer":
  • Which mouse button is reported on a right top corner tap.
  • Option "RBCornerButton" "integer":
  • Which mouse button is reported on a right bottom corner tap.
  • Option "LTCornerButton" "integer":
  • Which mouse button is reported on a left top corner tap.
  • Option "LBCornerButton" "integer":
  • Which mouse button is reported on a left bottom corner tap.
  • Option "TapButton1" "integer":
  • Which mouse button is reported on a non-corner one-finger tap.
  • Option "TapButton2" "integer":
  • Which mouse button is reported on a non-corner two-finger tap.
  • Option "TapButton3" "integer":
  • Which mouse button is reported on a non-corner
  • three-finger tap. *

func (*Touchpad) EnableTwoFingerScroll

func (tpad *Touchpad) EnableTwoFingerScroll(vert, horiz bool) error

*

  • Property 'Synaptics Two-Finger Scrolling' 8 bit (BOOL),
  • 2 values, vertical, horizontal.
  • Option "VertTwoFingerScroll" "boolean":
  • Enable vertical scrolling when dragging with
  • two fingers anywhere on the touchpad.
  • Option "HorizTwoFingerScroll" "boolean" :
  • Enable horizontal scrolling when dragging with
  • two fingers anywhere on the touchpad. *

func (*Touchpad) GetPalmDimensions

func (tpad *Touchpad) GetPalmDimensions() (int32, int32, error)

func (*Touchpad) IsEnabled

func (tpad *Touchpad) IsEnabled() bool

func (*Touchpad) MotionAcceleration

func (tpad *Touchpad) MotionAcceleration() (float32, error)

func (*Touchpad) MotionScaling

func (tpad *Touchpad) MotionScaling() (float32, error)

func (*Touchpad) MotionThreshold

func (tpad *Touchpad) MotionThreshold() (float32, error)

func (*Touchpad) ScrollDistance

func (tpad *Touchpad) ScrollDistance() (int32, int32)

func (*Touchpad) SetMotionAcceleration

func (tpad *Touchpad) SetMotionAcceleration(accel float32) error

func (*Touchpad) SetMotionScaling

func (tpad *Touchpad) SetMotionScaling(scaling float32) error

func (*Touchpad) SetMotionThreshold

func (tpad *Touchpad) SetMotionThreshold(thres float32) error

func (*Touchpad) SetPalmDimensions

func (tpad *Touchpad) SetPalmDimensions(width, z int32) error

'Synaptics Palm Dimensions' 32 bit, 2 values, width, z

func (*Touchpad) SetRotation

func (tpad *Touchpad) SetRotation(direction uint8) error

func (*Touchpad) SetScrollDistance

func (tpad *Touchpad) SetScrollDistance(vert, horiz int32) error

type Touchscreen

type Touchscreen struct {
	Id   int32
	Name string
	// contains filtered or unexported fields
}

func NewTouchscreen

func NewTouchscreen(id int32) (*Touchscreen, error)

func NewTouchscreenFromDevInfo

func NewTouchscreenFromDevInfo(dev *utils.DeviceInfo) (*Touchscreen, error)

func (*Touchscreen) Enable

func (touch *Touchscreen) Enable(enabled bool) error

func (*Touchscreen) IsEnabled

func (touch *Touchscreen) IsEnabled() bool

func (*Touchscreen) SetRotation

func (touch *Touchscreen) SetRotation(direction uint8) error

type Wacom

type Wacom struct {
	Id   int32
	Name string
}

func NewWacom

func NewWacom(id int32) (*Wacom, error)

func NewWacomFromDevInfo

func NewWacomFromDevInfo(dev *utils.DeviceInfo) (*Wacom, error)

func (*Wacom) GetArea

func (w *Wacom) GetArea() (x1, y1, x2, y2 int, err error)

GetArea get the tablet input area

func (*Wacom) MapToOutput

func (w *Wacom) MapToOutput(output string) error

Mapping PC screen to tablet, such as "VGA1"

func (*Wacom) QueryType

func (w *Wacom) QueryType() int

func (*Wacom) ResetArea

func (w *Wacom) ResetArea() error

func (*Wacom) SetArea

func (w *Wacom) SetArea(x1, y1, x2, y2 int) error

Area x1 y1 x2 y2 Set the tablet input area in device coordinates in the form top left x/y and bottom right x/y.

func (*Wacom) SetButton

func (w *Wacom) SetButton(btn int, value string) error

Button button-number [mapping] Set a mapping for the specified button-number. Numeric button mappings indicate what X11 button number the given button-number should correspond to. For example, a mapping of "3" means a press of the given button-number will produce as a press of X11 button 3 (i.e. right click).

Action mappings allow button presses to perform many events. They take the form of a string of keywords and arguments. For example, "key +a +shift b -shift -a" converts the button into a series of keystrokes, in this example "press a, press shift, press and release b, release shift, release a".

func (*Wacom) SetMode

func (w *Wacom) SetMode(mode string) error

Mode Absolute|Relative Set the device mode as either Relative or Absolute. Relative means pointer tracking for the device will function like a mouse. Absolute means the pointer corresponds to the device's actual position on the tablet or tablet PC screen.

func (*Wacom) SetPressureCurve

func (w *Wacom) SetPressureCurve(x1, y1, x2, y2 int) error

PressureCurve x1 y1 x2 y2 A Bezier curve of third order, composed of two anchor points (0,0 and 100,100) and two user modifiable control points that define the curve's shape. Raise the curve (x1<y1 x2<y2) to "soften" the feel and lower the curve (x1>y1 x2>y2) for a "firmer" feel. Sigmoid shaped curves are permitted (x1>y1 x2<y2 or x1<y1 x2>y2).

Default: 0 0 100 100, a linear curve. range of 0 to 100 for all four values.

func (*Wacom) SetRawSample

func (w *Wacom) SetRawSample(sample uint32) error

The the window size for incoming input tool raw data points Default: 4, range of 1 to 20

func (*Wacom) SetRotate

func (w *Wacom) SetRotate(value string) error

Rotate valid values: none|half|cw|ccw none: the tablet is not rotated and uses its natural rotation half: the tablet is rotated by 180 degrees (upside-down) cw : the tablet is rotated 90 degrees clockwise ccw : the tablet is rotated 90 degrees counter-clockwise

func (*Wacom) SetSuppress

func (w *Wacom) SetSuppress(value int) error

Suppress level Set the delta (difference) cutoff level for further processing of incoming input tool coordinate values. To disable suppression use a level of 0. Default: 2, range of 0 to 100.

func (*Wacom) SetThreshold

func (w *Wacom) SetThreshold(thres int) error

Threshold level Set the minimum pressure necessary to generate a Button event for the stylus tip, eraser, or touch. The pressure levels of all tablets are normalized to 2048 levels irregardless of the actual hardware supported levels. This parameter is independent of the PressureCurve parameter. Default: 27, range of 0 to 2047.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL