Logo Search packages:      
Sourcecode: synaptiks version File versions  Download package

Public Types | Public Slots | Public Member Functions | Static Public Member Functions | Properties | Private Member Functions | Private Attributes

synaptiks::Touchpad Class Reference

Control and configure a synaptics touchpad. More...

#include <touchpad.h>

Collaboration diagram for synaptiks::Touchpad:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Capability {
  LeftButtonCapability = 0x1, MiddleButtonCapability = 0x2, RightButtonCapability = 0x4, TwoFingersCapability = 0x8,
  ThreeFingersCapability = 0x16
}
 

The touchpad capabilities.

More...
enum  CircularScrollingTrigger {
  AnyEdgeTrigger = 0, TopEdgeTrigger = 1, TopRightCornerTrigger = 2, RightEdgeTrigger = 3,
  BottomRightCornerTrigger = 4, BottomEdgeTrigger = 5, BottomLeftCornerTrigger = 6, LeftEdgeTrigger = 7,
  TopLeftCornerTrigger = 8
}
 

The touchpad areas, which trigger circular scrolling.

More...

Public Slots

Q_SCRIPTABLE float accelerationFactor () const
 Get the acceleration factor.
Capabilities capabilities () const
 Query the touchpad capabilities.
Q_SCRIPTABLE bool circularScrolling () const
 Is circular scrolling enabled?
Q_SCRIPTABLE float circularScrollingDistance () const
 Return the move angle of the finger to generate a scroll event in circular scrolling mode.
Q_SCRIPTABLE
CircularScrollingTrigger 
circularScrollingTrigger () const
 Return the part of the touchpad, that triggers circular scrolling.
Q_SCRIPTABLE bool circularTouchpad () const
 Whether the touchpad is considered as circular touchpad.
Q_SCRIPTABLE float coastingSpeed () const
 Get the coasting speed.
Q_SCRIPTABLE QByteArray cornerButtons () const
 Query the mouse buttons triggered by tapping the touchpad corners.
Q_SCRIPTABLE bool cornerCoasting () const
 Is corner coasting enabled?
Q_SCRIPTABLE bool edgeMotionAlways () const
 Is edge motion always active, or only when dragging?
Q_SCRIPTABLE bool fastTaps () const
 Whether fast taps are enabled.
Q_SCRIPTABLE QByteArray fingerButtons () const
 Query the mouse buttons triggered by tapping the touchpad.
Q_SCRIPTABLE int fingerDetection () const
 How many fingers are detected by this touchpad?
Q_SCRIPTABLE bool hasLeftButton () const
 Does the touchpad have a left button?
Q_SCRIPTABLE bool hasMiddleButton () const
 Does the touchpad have a middle button?
Q_SCRIPTABLE bool hasRightButton () const
 Does the touchpad have a right button?
Q_SCRIPTABLE bool horizontalEdgeScrolling () const
 Is horizontal scrolling at the bottom edge enabled?
Q_SCRIPTABLE int horizontalScrollingDistance () const
 Return the move distance of the finger to generate a horizontal scroll event.
Q_SCRIPTABLE bool horizontalTwoFingerScrolling () const
 Is horizontal two-finger scrolling enabled?
Q_SCRIPTABLE bool isOn () const
 Is the touchpad on?
Q_SCRIPTABLE bool lockedDrags () const
 Are locked drags enabled?
Q_SCRIPTABLE int lockedDragsTimeout () const
 Get the timeout for a lock drag to expire.
Q_SCRIPTABLE float maximumSpeed () const
 Return the maximum motion speed.
Q_SCRIPTABLE float minimumSpeed () const
 Return the minimum motion speed.
Q_SCRIPTABLE QString name () const
 Return the human-readable name of this touchpad.
Q_SCRIPTABLE void setAccelerationFactor (float accel)
 Set the acceleration factor.
Q_SCRIPTABLE void setCircularScrolling (bool enabled)
 Enabled or disable circular scrolling.
Q_SCRIPTABLE void setCircularScrollingDistance (float angle)
 Set the move angle of the finger to generate a scroll event in circular scrolling mode.
Q_SCRIPTABLE void setCircularScrollingTrigger (CircularScrollingTrigger trigger)
 Set the trigger for circular scrolling.
Q_SCRIPTABLE void setCircularTouchpad (bool circular)
 Configure, if the touchpad is circular or not.
Q_SCRIPTABLE void setCoastingSpeed (float speed)
 Set the coasting speed.
Q_SCRIPTABLE void setCornerButtons (const QByteArray &buttons)
 Set the mouse buttons triggered by tapping the touchpad corners.
Q_SCRIPTABLE void setCornerCoasting (bool enabled)
 Enable or disable corner coasting.
Q_SCRIPTABLE void setEdgeMotionAlways (bool enabled)
 Enable edge motion for all movements.
Q_SCRIPTABLE void setFastTaps (bool enabled)
 Enable or disable fast taps.
Q_SCRIPTABLE void setFingerButtons (const QByteArray &buttons)
 Set the mouse buttons triggered by tapping the touchpad.
Q_SCRIPTABLE void setHorizontalEdgeScrolling (bool enabled)
 Enable or disable horizontal scrolling at the bottom edge.
Q_SCRIPTABLE void setHorizontalScrollingDistance (int distance)
 Set the move distance of the finger to generate a horizontal scroll event.
Q_SCRIPTABLE void setHorizontalTwoFingerScrolling (bool enabled)
 Enable or disable horizontal two-finger scrolling.
Q_SCRIPTABLE void setLockedDrags (bool enabled)
 Enable or disable locked drags.
Q_SCRIPTABLE void setLockedDragsTimeout (int timeout)
 Set the timeout for a locked drag to expire.
Q_SCRIPTABLE void setMaximumSpeed (float speed)
 Set the maximum motion speed.
Q_SCRIPTABLE void setMinimumSpeed (float speed)
 Set the minimum motion speed.
Q_SCRIPTABLE void setOn (bool on)
 Switch the touchpad according to the given parameter.
Q_SCRIPTABLE void setTapAndDragGesture (bool enabled)
 Enable or disable the tap-and-drag gesture.
Q_SCRIPTABLE void setVerticalEdgeScrolling (bool enabled)
 Enable or disable vertical scrolling at the right edge.
Q_SCRIPTABLE void setVerticalScrollingDistance (int distance)
 Set the move distance of the finger to generate a vertical scroll event.
Q_SCRIPTABLE void setVerticalTwoFingerScrolling (bool enabled)
 Enable or disable vertical two-finger scrolling.
Q_SCRIPTABLE bool tapAndDragGesture () const
 Is the tap-and-drag gesture enabled?
Q_SCRIPTABLE bool verticalEdgeScrolling () const
 Is vertical scrolling at the right edge enabled?
Q_SCRIPTABLE int verticalScrollingDistance () const
 Return the move distance of the finger to generate a vertical scroll event.
Q_SCRIPTABLE bool verticalTwoFingerScrolling () const
 Is vertical two-finger scrolling enabled?

Public Member Functions

 ~Touchpad ()

Static Public Member Functions

static TouchpadfindTouchpad (QObject *parent=0)
 Find the touchpad on this system.
static bool isSupported ()
 Check, whether device properties are supported.

Properties

float accelerationFactor
 The scaling between minimumSpeed and maximumSpeed.
Capabilities capabilities
 The capabilities of the touchpad.
bool circularScrolling
 Whether circular scrolling is enabled or not.
float circularScrollingDistance
 Move angle in radians of the finger to generate a scrolling event in circular scrolling mode.
CircularScrollingTrigger circularScrollingTrigger
 The touchpad area, which triggers circular scrolling.
bool circularTouchpad
 Whether or not the touchpad is considered as circular touchpad.
float coastingSpeed
 The threshold speed (in scrolling events per second) for conventional coasting.
QByteArray cornerButtons
 The mouse buttons triggered by tapping the touchpad corner.
bool cornerCoasting
 Whether corner coasting is enabled or not.
bool edgeMotionAlways
 Use edge motion always.
bool fastTaps
 Whether or not fast tapping is enabled.
QByteArray fingerButtons
 The mouse buttons triggered by tapping the touchpad with a given amount of fingers concurrently.
int fingerDetection
 How many fingers are detected by the touchpad.
bool hasLeftButton
 Whether this touchpad provides a left mouse button.
bool hasMiddleButton
 Whether this touchpad provides a middle mouse button.
bool hasRightButton
 Whether this touchpad provides a right mouse button.
bool horizontalEdgeScrolling
 Whether horizontal scrolling at the bottom edge of the touchpad is enabled or not.
int horizontalScrollingDistance
 The speed of horizontal scrolling.
bool horizontalTwoFingerScrolling
 Whether horizontal scrolling with two fingres is enabled or not.
bool lockedDrags
 Continue a tap-and-drag gesture after releasing the finger.
int lockedDragsTimeout
 The timeout of locked drag mode in milliseconds.
float maximumSpeed
 The maximum speed of cursor motion.
float minimumSpeed
 The minimum speed of cursor motion.
QString name
 The touchpad name.
bool on
 Is the touchpad on?
bool tapAndDragGesture
 Enable or disable the tap-and-drag gesture.
bool verticalEdgeScrolling
 Whether vertical scrolling at the right edge of the touchpad is enabled or not.
int verticalScrollingDistance
 The speed of vertical scrolling.
bool verticalTwoFingerScrolling
 Whether vertical scrolling with two fingres is enabled or not.

Private Member Functions

 Touchpad (QSharedPointer< QXDevice > device, QObject *parent=0)
 Create a new touchpad instance.

Private Attributes

TouchpadPrivate *const d_ptr

Detailed Description

Control and configure a synaptics touchpad.

Usage

This class uses input device properties to access the touchpad, which are supported as of Xorg 1.6.

Usage is quite simple, just create an object of this class:

 Touchpad *touchpad = Touchpad::findTouchpad(parent);
 if (touchpad) {
     # a touchpad was found, use it
 }

If a touchpad was found, you can easily access and change its properties, but be sure to catch errors! The Touchpad class simply passes errors from QXDevice to the caller, so handle QXDeviceError and its subclasses:

 try {
     touchpad->setOn(true);
     touchpad->setCircularScrolling(true);
     kDebug() << "your touchpad supports" << touchpad->fingerDetection()
              << "fingers";
 } catch (const QXDeviceError &error) {
     kWarning() << error.toString();
 }

D-Bus

All members marked as Q_SCRIPTABLE (except properties, which are not exported) are exported on D-Bus on the interface org.kde.Touchpad. The adaptor catches all QXDeviceError exceptions and turns them into the D-Bus error org.kde.TouchpadError. The error message is the same as for QXDeviceError::toString().

Definition at line 101 of file touchpad.h.


The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index