- class QInputEvent#
The
QInputEvent
class is the base class for events that describe user input. More…Inherited by:
QPointerEvent
,QTouchEvent
,QSinglePointEvent
,QWheelEvent
,QTabletEvent
,QNativeGestureEvent
,QMouseEvent
,QHoverEvent
,QEnterEvent
,QKeyEvent
,QContextMenuEvent
Synopsis#
Methods#
def
__init__()
def
device()
def
deviceType()
def
modifiers()
def
setModifiers()
def
timestamp()
Virtual methods#
def
setTimestamp()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
- __init__(type, m_dev[, modifiers=Qt.NoModifier])#
- Parameters:
type –
Type
m_dev –
QInputDevice
modifiers – Combination of
KeyboardModifier
- __init__(arg__1)
- Parameters:
arg__1 –
QInputEvent
- device()#
- Return type:
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. ThusmouseEvent.source()->type() != QInputDevice::DeviceType::Mouse
is one possible replacement for the Qt 5 expressionmouseEvent.source() == Qt::MouseEventSynthesizedByQt
.See also
- deviceType()#
- Return type:
Returns the type of device that generated the event.
- modifiers()#
- Return type:
Combination of
KeyboardModifier
Returns the keyboard modifier flags that existed immediately before the event occurred.
See also
- setModifiers(modifiers)#
- Parameters:
modifiers – Combination of
KeyboardModifier
- setTimestamp(timestamp)#
- Parameters:
timestamp – int
- 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.