KWayland::Client::FakeInput

KWayland::Client::FakeInput Class Reference

#include <fakeinput.h>

Inheritance diagram for KWayland::Client::FakeInput:

Signals

void removed ()
 

Public Member Functions

 FakeInput (QObject *parent=nullptr)
 
void authenticate (const QString &applicationName, const QString &reason)
 
void destroy ()
 
EventQueueeventQueue ()
 
bool isValid () const
 
 operator org_kde_kwin_fake_input * ()
 
 operator org_kde_kwin_fake_input * () const
 
void release ()
 
void requestKeyboardKeyPress (quint32 linuxKey)
 
void requestKeyboardKeyRelease (quint32 linuxKey)
 
void requestPointerAxis (Qt::Orientation axis, qreal delta)
 
void requestPointerButtonClick (Qt::MouseButton button)
 
void requestPointerButtonClick (quint32 linuxButton)
 
void requestPointerButtonPress (Qt::MouseButton button)
 
void requestPointerButtonPress (quint32 linuxButton)
 
void requestPointerButtonRelease (Qt::MouseButton button)
 
void requestPointerButtonRelease (quint32 linuxButton)
 
void requestPointerMove (const QSizeF &delta)
 
void requestPointerMoveAbsolute (const QPointF &pos)
 
void requestTouchCancel ()
 
void requestTouchDown (quint32 id, const QPointF &pos)
 
void requestTouchFrame ()
 
void requestTouchMotion (quint32 id, const QPointF &pos)
 
void requestTouchUp (quint32 id)
 
void setEventQueue (EventQueue *queue)
 
void setup (org_kde_kwin_fake_input *manager)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

Wrapper for the org_kde_kwin_fake_input interface.

FakeInput allows to fake input events into the Wayland server. This is a privileged Wayland interface and the Wayland server is allowed to ignore all events.

This class provides a convenient wrapper for the org_kde_kwin_fake_input interface.

To use this class one needs to interact with the Registry. There are two possible ways to create the FakeInput interface:

FakeInput *m = registry->createFakeInput(name, version);

This creates the FakeInput and sets it up directly. As an alternative this can also be done in a more low level way:

m->setup(registry->bindFakeInput(name, version));

The FakeInput can be used as a drop-in replacement for any org_kde_kwin_fake_input pointer as it provides matching cast operators.

See also
Registry

Definition at line 50 of file fakeinput.h.

Constructor & Destructor Documentation

KWayland::Client::FakeInput::FakeInput ( QObject parent = nullptr)
explicit

Creates a new FakeInput.

Note: after constructing the FakeInput it is not yet valid and one needs to call setup. In order to get a ready to use FakeInput prefer using Registry::createFakeInput.

Definition at line 34 of file fakeinput.cpp.

Member Function Documentation

void KWayland::Client::FakeInput::authenticate ( const QString applicationName,
const QString reason 
)

Authenticate with the Wayland server in order to request sending fake input events.

The Wayland server might ignore all requests without a prior authentication.

The Wayland server might use the provided applicationName and reason to ask the user whether this request should get authenticated.

There is no way for the client to figure out whether the authentication was granted or denied. The client should assume that it wasn't granted.

Parameters
applicationNameA human readable description of the application
reasonA human readable explanation why this application wants to send fake requests

Definition at line 77 of file fakeinput.cpp.

void KWayland::Client::FakeInput::destroy ( )

Destroys the data held by this FakeInput.

This method is supposed to be used when the connection to the Wayland server goes away. If the connection is not valid anymore, it's not possible to call release anymore as that calls into the Wayland connection and the call would fail. This method cleans up the data, so that the instance can be deleted or set up to a new org_kde_kwin_fake_input interface once there is a new connection available.

This method is automatically invoked when the Registry which created this FakeInput gets destroyed.

See also
release

Definition at line 50 of file fakeinput.cpp.

EventQueue * KWayland::Client::FakeInput::eventQueue ( )
Returns
The event queue to use for bound proxies.

Definition at line 67 of file fakeinput.cpp.

bool KWayland::Client::FakeInput::isValid ( ) const
Returns
true if managing a org_kde_kwin_fake_input.

Definition at line 55 of file fakeinput.cpp.

void KWayland::Client::FakeInput::release ( )

Releases the org_kde_kwin_fake_input interface.

After the interface has been released the FakeInput instance is no longer valid and can be setup with another org_kde_kwin_fake_input interface.

Definition at line 45 of file fakeinput.cpp.

void KWayland::Client::FakeInput::removed ( )
signal

The corresponding global for this interface on the Registry got removed.

This signal gets only emitted if the Compositor got created by Registry::createFakeInput

Since
5.5
void KWayland::Client::FakeInput::requestKeyboardKeyPress ( quint32  linuxKey)

Request a keyboard key press.

Parameters
linuxButtonThe button code as defined in linux/input-event-codes.h
Since
5.63

Definition at line 205 of file fakeinput.cpp.

void KWayland::Client::FakeInput::requestKeyboardKeyRelease ( quint32  linuxKey)

Request a keyboard button release.

Parameters
linuxButtonThe button code as defined in linux/input-event-codes.h
Since
5.63

Definition at line 215 of file fakeinput.cpp.

void KWayland::Client::FakeInput::requestPointerAxis ( Qt::Orientation  axis,
qreal  delta 
)

Request a scroll of the pointer axis with delta.

Definition at line 157 of file fakeinput.cpp.

void KWayland::Client::FakeInput::requestPointerButtonClick ( Qt::MouseButton  button)

Convenience overload.

See also
requestPointerButtonClick(quint32)

Definition at line 145 of file fakeinput.cpp.

void KWayland::Client::FakeInput::requestPointerButtonClick ( quint32  linuxButton)

Requests a pointer button click, that is a press directly followed by a release.

Parameters
linuxButtonThe button code as defined in linux/input-event-codes.h

Definition at line 151 of file fakeinput.cpp.

void KWayland::Client::FakeInput::requestPointerButtonPress ( Qt::MouseButton  button)

Convenience overload.

See also
requestPointerButtonPress(quint32)

Definition at line 123 of file fakeinput.cpp.

void KWayland::Client::FakeInput::requestPointerButtonPress ( quint32  linuxButton)

Request a pointer button press.

Parameters
linuxButtonThe button code as defined in linux/input-event-codes.h

Definition at line 128 of file fakeinput.cpp.

void KWayland::Client::FakeInput::requestPointerButtonRelease ( Qt::MouseButton  button)

Convenience overload.

See also
requestPointerButtonRelease(quint32)

Definition at line 134 of file fakeinput.cpp.

void KWayland::Client::FakeInput::requestPointerButtonRelease ( quint32  linuxButton)

Request a pointer button release.

Parameters
linuxButtonThe button code as defined in linux/input-event-codes.h

Definition at line 139 of file fakeinput.cpp.

void KWayland::Client::FakeInput::requestPointerMove ( const QSizeF delta)

Request a relative pointer motion of delta pixels.

Definition at line 83 of file fakeinput.cpp.

void KWayland::Client::FakeInput::requestPointerMoveAbsolute ( const QPointF pos)

Request an absolute pointer motion to pos position.

Since
5.54

Definition at line 89 of file fakeinput.cpp.

void KWayland::Client::FakeInput::requestTouchCancel ( )

Requests to cancel the current touch event sequence.

Since
5.23

Definition at line 193 of file fakeinput.cpp.

void KWayland::Client::FakeInput::requestTouchDown ( quint32  id,
const QPointF pos 
)

Request a touch down at pos in global coordinates.

If this is the first touch down it starts a touch sequence.

Parameters
idThe id to identify the touch point
posThe global position of the touch point
See also
requestTouchMotion
requestTouchUp
Since
5.23

Definition at line 175 of file fakeinput.cpp.

void KWayland::Client::FakeInput::requestTouchFrame ( )

Requests a touch frame.

This allows to manipulate multiple touch points in one event and notify that the set of touch events for the current frame are finished.

Since
5.23

Definition at line 199 of file fakeinput.cpp.

void KWayland::Client::FakeInput::requestTouchMotion ( quint32  id,
const QPointF pos 
)

Request a move of the touch point identified by id to new global pos.

Parameters
idThe id to identify the touch point
posThe global position of the touch point
See also
requestTouchDown
Since
5.23

Definition at line 181 of file fakeinput.cpp.

void KWayland::Client::FakeInput::requestTouchUp ( quint32  id)

Requests a touch up of the touch point identified by id.

Parameters
idThe id to identify the touch point
Since
5.23

Definition at line 187 of file fakeinput.cpp.

void KWayland::Client::FakeInput::setEventQueue ( EventQueue queue)

Sets the queue to use for bound proxies.

Definition at line 72 of file fakeinput.cpp.

void KWayland::Client::FakeInput::setup ( org_kde_kwin_fake_input *  manager)

Setup this FakeInput to manage the manager.

When using Registry::createFakeInput there is no need to call this method.

Definition at line 60 of file fakeinput.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Sep 18 2020 22:49:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.