|
| SeatInterface (Display *display, QObject *parent=nullptr) |
|
virtual | ~SeatInterface () |
|
Display * | display () const |
|
QString | name () const |
|
bool | hasPointer () const |
|
bool | hasKeyboard () const |
|
bool | hasTouch () const |
|
void | setName (const QString &name) |
|
void | setHasPointer (bool has) |
|
void | setHasKeyboard (bool has) |
|
void | setHasTouch (bool has) |
|
void | setTimestamp (std::chrono::microseconds time) |
|
std::chrono::milliseconds | timestamp () const |
|
AbstractDropHandler * | dropHandlerForSurface (SurfaceInterface *surface) const |
|
void | cancelDrag () |
|
void | setFocusedKeyboardSurface (SurfaceInterface *surface) |
|
SurfaceInterface * | focusedKeyboardSurface () const |
|
KeyboardInterface * | keyboard () const |
|
void | notifyKeyboardKey (quint32 keyCode, KeyboardKeyState state) |
|
void | notifyKeyboardModifiers (quint32 depressed, quint32 latched, quint32 locked, quint32 group) |
|
AbstractDataSource * | selection () const |
|
void | setSelection (AbstractDataSource *selection) |
|
AbstractDataSource * | primarySelection () const |
|
void | setPrimarySelection (AbstractDataSource *selection) |
|
void | startDrag (AbstractDataSource *source, SurfaceInterface *sourceSurface, int dragSerial=-1, DragAndDropIcon *dragIcon=nullptr) |
|
DragAndDropIcon * | dragIcon () const |
|
|
bool | isDrag () const |
|
bool | isDragPointer () const |
|
bool | isDragTouch () const |
|
QMatrix4x4 | dragSurfaceTransformation () const |
|
SurfaceInterface * | dragSurface () const |
|
AbstractDataSource * | dragSource () const |
|
XdgToplevelDragV1Interface * | xdgTopleveldrag () const |
|
void | setDragTarget (AbstractDropHandler *dropTarget, SurfaceInterface *surface, const QPointF &globalPosition, const QMatrix4x4 &inputTransformation) |
|
void | setDragTarget (AbstractDropHandler *dropTarget, SurfaceInterface *surface, const QMatrix4x4 &inputTransformation=QMatrix4x4()) |
|
|
void | notifyPointerMotion (const QPointF &pos) |
|
QPointF | pointerPos () const |
|
void | notifyPointerEnter (SurfaceInterface *surface, const QPointF &position, const QPointF &surfacePosition=QPointF()) |
|
void | notifyPointerEnter (SurfaceInterface *surface, const QPointF &position, const QMatrix4x4 &transformation) |
|
void | notifyPointerLeave () |
|
SurfaceInterface * | focusedPointerSurface () const |
|
PointerInterface * | pointer () const |
|
void | setFocusedPointerSurfacePosition (const QPointF &surfacePosition) |
|
QPointF | focusedPointerSurfacePosition () const |
|
void | setFocusedPointerSurfaceTransformation (const QMatrix4x4 &transformation) |
|
QMatrix4x4 | focusedPointerSurfaceTransformation () const |
|
void | notifyPointerButton (quint32 button, PointerButtonState state) |
|
void | notifyPointerButton (Qt::MouseButton button, PointerButtonState state) |
|
void | notifyPointerFrame () |
|
bool | isPointerButtonPressed (quint32 button) const |
|
bool | isPointerButtonPressed (Qt::MouseButton button) const |
|
quint32 | pointerButtonSerial (quint32 button) const |
|
quint32 | pointerButtonSerial (Qt::MouseButton button) const |
|
void | notifyPointerAxis (Qt::Orientation orientation, qreal delta, qint32 deltaV120, PointerAxisSource source, PointerAxisRelativeDirection direction=PointerAxisRelativeDirection::Normal) |
|
bool | hasImplicitPointerGrab (quint32 serial) const |
|
void | relativePointerMotion (const QPointF &delta, const QPointF &deltaNonAccelerated, std::chrono::microseconds timestamp) |
|
void | startPointerSwipeGesture (quint32 fingerCount) |
|
void | updatePointerSwipeGesture (const QPointF &delta) |
|
void | endPointerSwipeGesture () |
|
void | cancelPointerSwipeGesture () |
|
void | startPointerPinchGesture (quint32 fingerCount) |
|
void | updatePointerPinchGesture (const QPointF &delta, qreal scale, qreal rotation) |
|
void | endPointerPinchGesture () |
|
void | cancelPointerPinchGesture () |
|
void | startPointerHoldGesture (quint32 fingerCount) |
|
void | endPointerHoldGesture () |
|
void | cancelPointerHoldGesture () |
|
|
void | setFocusedTouchSurface (SurfaceInterface *surface, const QPointF &surfacePosition=QPointF()) |
|
SurfaceInterface * | focusedTouchSurface () const |
|
TouchInterface * | touch () const |
|
void | setFocusedTouchSurfacePosition (const QPointF &surfacePosition) |
|
QPointF | focusedTouchSurfacePosition () const |
|
void | notifyTouchDown (qint32 id, const QPointF &globalPosition) |
|
void | notifyTouchUp (qint32 id) |
|
void | notifyTouchMotion (qint32 id, const QPointF &globalPosition) |
|
void | notifyTouchFrame () |
|
void | notifyTouchCancel () |
|
bool | isTouchSequence () const |
|
QPointF | firstTouchPointPosition () const |
|
bool | hasImplicitTouchGrab (quint32 serial) const |
|
|
void | setFocusedTextInputSurface (SurfaceInterface *surface) |
|
SurfaceInterface * | focusedTextInputSurface () const |
|
TextInputV1Interface * | textInputV1 () const |
|
TextInputV2Interface * | textInputV2 () const |
|
TextInputV3Interface * | textInputV3 () const |
|
Represents a Seat on the Wayland Display.
A Seat is a set of input devices (e.g. Keyboard, Pointer and Touch) the client can connect to. The server needs to announce which input devices are supported and passes dedicated input focus to a SurfaceInterface. Only the focused surface receives input events.
The SeatInterface internally handles enter and release events when setting a focused surface. Also it handles input translation from global to the local coordination, removing the need from the user of the API to track the focused surfaces and can just interact with this class.
To create a SeatInterface use Display::createSeat. Then one can set up what is supported. Last but not least create needs to be called.
seat->setName(QStringLiteral("seat0"));
seat->setHasPointer(true);
seat->setHasKeyboard(true);
seat->setHasTouch(false);
seat->create();
Represents a Seat on the Wayland Display.
Display * display() const
To forward input events one needs to set the focused surface, update time stamp and then forward the actual events:
seat->setTimestamp(100);
seat->notifyPointerEnter(surface, QPointF(350, 210), QPointF(100, 200));
seat->notifyPointerFrame();
seat->setTimestamp(110);
seat->notifyPointerFrame();
seat->setTimestamp(120);
seat->notifyPointerFrame();
- See also
- KeyboardInterface
-
PointerInterface
-
TouchInterface
-
SurfaceInterface
Definition at line 133 of file seat.h.
void KWin::SeatInterface::notifyPointerEnter |
( |
SurfaceInterface * | surface, |
|
|
const QPointF & | position, |
|
|
const QPointF & | surfacePosition = QPointF() ) |
Sets the focused pointer surface
. All pointer events will be sent to the surface
till a new focused pointer surface gets installed. When the focus pointer surface changes a leave event is sent to the previous focused surface.
To unset the focused pointer surface pass nullptr
as surface
.
Pointer motion events are adjusted to the local position based on the surfacePosition
. If the surface changes it's position in the global coordinate system use setFocusedPointerSurfacePosition to update. The surface position is used to create the base transformation matrix to go from global to surface local coordinates. The default generated matrix is a translation with negative surfacePosition
.
- Parameters
-
surface | The surface which should become the new focused pointer surface. |
surfacePosition | The position of the surface in the global coordinate system |
- See also
- setPointerPos
-
focucedPointerSurface
-
focusedPointer
-
setFocusedPointerSurfacePosition
-
focusedPointerSurfacePosition
-
setFocusedPointerSurfaceTransformation
-
focusedPointerSurfaceTransformation
Definition at line 555 of file seat.cpp.
void KWin::SeatInterface::relativePointerMotion |
( |
const QPointF & | delta, |
|
|
const QPointF & | deltaNonAccelerated, |
|
|
std::chrono::microseconds | timestamp ) |
A relative motion is in the same dimension as regular motion events, except they do not represent an absolute position. For example, moving a pointer from (x, y) to (x', y') would have the equivalent relative motion (x' - x, y' - y). If a pointer motion caused the absolute pointer position to be clipped by for example the edge of the monitor, the relative motion is unaffected by the clipping and will represent the unclipped motion.
This method also contains non-accelerated motion deltas (deltaNonAccelerated
). The non-accelerated delta is, when applicable, the regular pointer motion delta as it was before having applied motion acceleration and other transformations such as normalization.
Note that the non-accelerated delta does not represent 'raw' events as they were read from some device. Pointer motion acceleration is device- and configuration-specific and non-accelerated deltas and accelerated deltas may have the same value on some devices.
Relative motions are not coupled to wl_pointer.motion events (see setPointerPos
, and can be sent in combination with such events, but also independently. There may also be scenarios where wl_pointer.motion is sent, but there is no relative motion. The order of an absolute and relative motion event originating from the same physical motion is not guaranteed.
Sending relative pointer events only makes sense if the RelativePointerManagerInterface is created on the Display.
- Parameters
-
delta | Motion vector |
deltaNonAccelerated | non-accelerated motion vector |
microseconds | timestamp with microseconds granularity |
- See also
- setPointerPos
Definition at line 766 of file seat.cpp.
void KWin::SeatInterface::startPointerHoldGesture |
( |
quint32 | fingerCount | ) |
|
Starts a multi-finger hold gesture for the currently focused pointer surface.
Such gestures are normally reported through dedicated input devices such as touchpads.
The gesture is usually initiated by multiple fingers being held down on the touchpad. The precise conditions of when such a gesture is detected are implementation-dependent.
Only one gesture (either swipe or pinch or hold) can be active at a given time.
- Parameters
-
fingerCount | The number of fingers involved in this multi-finger touchpad gesture |
- See also
- PointerGesturesInterface
-
focusedPointerSurface
-
endPointerHoldeGesture
-
cancelPointerHoldGesture
Definition at line 874 of file seat.cpp.
void KWin::SeatInterface::startPointerPinchGesture |
( |
quint32 | fingerCount | ) |
|
Starts a multi-finch pinch gesture for the currently focused pointer surface.
Such gestures are normally reported through dedicated input devices such as touchpads.
The gesture is usually initiated by multiple fingers moving towards each other or away from each other, or by two or more fingers rotating around a logical center of gravity. The precise conditions of when such a gesture is detected are implementation-dependent.
Only one gesture (either swipe or pinch or hold) can be active at a given time.
- Parameters
-
fingerCount | The number of fingers involved in this multi-touch touchpad gesture |
- See also
- PointerGesturesInterface
-
focusedPointerSurface
-
updatePointerPinchGesture
-
endPointerPinchGesture
-
cancelPointerPinchGesture
-
startPointerSwipeGesture
Definition at line 826 of file seat.cpp.
void KWin::SeatInterface::startPointerSwipeGesture |
( |
quint32 | fingerCount | ) |
|
Starts a multi-finger swipe gesture for the currently focused pointer surface.
Such gestures are normally reported through dedicated input devices such as touchpads.
The gesture is usually initiated by multiple fingers moving in the same direction but once initiated the direction may change. The precise conditions of when such a gesture is detected are implementation-dependent.
Only one gesture (either swipe or pinch or hold) can be active at a given time.
- Parameters
-
fingerCount | The number of fingers involved in this multi-finger touchpad gesture |
- See also
- PointerGesturesInterface
-
focusedPointerSurface
-
updatePointerSwipeGesture
-
endPointerSwipeGesture
-
cancelPointerSwipeGesture
-
startPointerPinchGesture
Definition at line 778 of file seat.cpp.