QInputEvent

The QInputEvent class is the base class for events that describe user input. More

Inheritance diagram of PySide6.QtGui.QInputEvent

Inherited by: QPointerEvent, QTouchEvent, QSinglePointEvent, QWheelEvent, QTabletEvent, QNativeGestureEvent, QMouseEvent, QHoverEvent, QEnterEvent, QKeyEvent, QContextMenuEvent

Synopsis

Functions

Virtual functions

Detailed Description

class PySide6.QtGui.QInputEvent(type, m_dev[, modifiers=Qt.NoModifier])

PySide6.QtGui.QInputEvent(arg__1)

Parameters
PySide6.QtGui.QInputEvent.device()
Return type

PySide6.QtGui.QInputDevice

Returns the source device that generated the original event.

In case of a synthesized event, for example a mouse event that was generated from a touch event, device() continues to return the touchscreen device, so that you can tell that it did not come from an actual mouse. Thus mouseEvent.source()->type() != QInputDevice::DeviceType::Mouse is one possible replacement for the Qt 5 expression mouseEvent.source() == Qt::MouseEventSynthesizedByQt.

See also

pointingDevice()

PySide6.QtGui.QInputEvent.deviceType()
Return type

DeviceType

Returns the type of device that generated the event.

PySide6.QtGui.QInputEvent.modifiers()
Return type

KeyboardModifiers

Returns the keyboard modifier flags that existed immediately before the event occurred.

PySide6.QtGui.QInputEvent.setModifiers(modifiers)
Parameters

modifiersKeyboardModifiers

See also

modifiers()

PySide6.QtGui.QInputEvent.setTimestamp(timestamp)
Parameters

timestamp – int

See also

timestamp()

PySide6.QtGui.QInputEvent.timestamp()
Return type

int

Returns the window system’s timestamp for this event. It will normally be in milliseconds since some arbitrary point in time, such as the time when the system was started.