Qt 4.8
Public Functions | Public Variables | List of all members
QWindowSystemInterfacePrivate::KeyEvent Class Reference

#include <qwindowsysteminterface_qpa_p.h>

Inheritance diagram for QWindowSystemInterfacePrivate::KeyEvent:
QWindowSystemInterfacePrivate::UserEvent QWindowSystemInterfacePrivate::WindowSystemEvent

Public Functions

 KeyEvent (QWidget *w, ulong time, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString &text=QString(), bool autorep=false, ushort count=1)
 
 KeyEvent (QWidget *w, ulong time, QEvent::Type t, int k, Qt::KeyboardModifiers mods, quint32 nativeSC, quint32 nativeVK, quint32 nativeMods, const QString &text=QString(), bool autorep=false, ushort count=1)
 
- Public Functions inherited from QWindowSystemInterfacePrivate::UserEvent
 UserEvent (QWidget *w, ulong time, EventType t)
 
- Public Functions inherited from QWindowSystemInterfacePrivate::WindowSystemEvent
 WindowSystemEvent (EventType t)
 
virtual ~WindowSystemEvent ()
 

Public Variables

int key
 This property holds the code of the key that was pressed or released. More...
 
QEvent::Type keyType
 
Qt::KeyboardModifiers modifiers
 This property holds the keyboard modifier flags that existed immediately before the event occurred. More...
 
quint32 nativeModifiers
 
quint32 nativeScanCode
 
quint32 nativeVirtualKey
 
bool repeat
 
ushort repeatCount
 
QString unicode
 
- Public Variables inherited from QWindowSystemInterfacePrivate::UserEvent
unsigned long timestamp
 
QWeakPointer< QWidgetwidget
 
- Public Variables inherited from QWindowSystemInterfacePrivate::WindowSystemEvent
EventType type
 

Detailed Description

Definition at line 155 of file qwindowsysteminterface_qpa_p.h.

Constructors and Destructors

◆ KeyEvent() [1/2]

QWindowSystemInterfacePrivate::KeyEvent::KeyEvent ( QWidget w,
ulong  time,
QEvent::Type  t,
int  k,
Qt::KeyboardModifiers  mods,
const QString text = QString(),
bool  autorep = false,
ushort  count = 1 
)
inline

Definition at line 157 of file qwindowsysteminterface_qpa_p.h.

158  :UserEvent(w, time, Key), key(k), unicode(text), repeat(autorep),
159  repeatCount(count), modifiers(mods), keyType(t),
Qt::KeyboardModifiers modifiers
This property holds the keyboard modifier flags that existed immediately before the event occurred...
UserEvent(QWidget *w, ulong time, EventType t)
int key
This property holds the code of the key that was pressed or released.

◆ KeyEvent() [2/2]

QWindowSystemInterfacePrivate::KeyEvent::KeyEvent ( QWidget w,
ulong  time,
QEvent::Type  t,
int  k,
Qt::KeyboardModifiers  mods,
quint32  nativeSC,
quint32  nativeVK,
quint32  nativeMods,
const QString text = QString(),
bool  autorep = false,
ushort  count = 1 
)
inline

Definition at line 161 of file qwindowsysteminterface_qpa_p.h.

164  :UserEvent(w, time, Key), key(k), unicode(text), repeat(autorep),
165  repeatCount(count), modifiers(mods), keyType(t),
166  nativeScanCode(nativeSC), nativeVirtualKey(nativeVK), nativeModifiers(nativeMods) { }
Qt::KeyboardModifiers modifiers
This property holds the keyboard modifier flags that existed immediately before the event occurred...
UserEvent(QWidget *w, ulong time, EventType t)
int key
This property holds the code of the key that was pressed or released.

Properties

◆ key

int KeyEvent::key

This property holds the code of the key that was pressed or released.

See Qt::Key{Qt.Key} for the list of keyboard codes. These codes are independent of the underlying window system. Note that this function does not distinguish between capital and non-capital letters, use the text() function (returning the Unicode text the key generated) for this purpose.

A value of either 0 or Qt::Key_unknown{Qt.Key_Unknown} means that the event is not the result of a known key; for example, it may be the result of a compose sequence, a keyboard macro, or due to key event compression.

Definition at line 167 of file qwindowsysteminterface_qpa_p.h.

Referenced by qt_cleanup().

◆ keyType

QEvent::Type QWindowSystemInterfacePrivate::KeyEvent::keyType

Definition at line 172 of file qwindowsysteminterface_qpa_p.h.

Referenced by qt_cleanup().

◆ modifiers

int KeyEvent::modifiers

This property holds the keyboard modifier flags that existed immediately before the event occurred.

It contains a bitwise combination of:

For example, to react to a Shift key + Enter key combination:

focus: true
Keys.onPressed: {
if ((event.key == Qt.Key_Enter) && (event.modifiers & Qt.ShiftModifier))
doSomething();
}
}

Definition at line 171 of file qwindowsysteminterface_qpa_p.h.

Referenced by qt_cleanup().

◆ nativeModifiers

quint32 QWindowSystemInterfacePrivate::KeyEvent::nativeModifiers

Definition at line 175 of file qwindowsysteminterface_qpa_p.h.

Referenced by qt_cleanup().

◆ nativeScanCode

quint32 QWindowSystemInterfacePrivate::KeyEvent::nativeScanCode

Definition at line 173 of file qwindowsysteminterface_qpa_p.h.

Referenced by qt_cleanup().

◆ nativeVirtualKey

quint32 QWindowSystemInterfacePrivate::KeyEvent::nativeVirtualKey

Definition at line 174 of file qwindowsysteminterface_qpa_p.h.

Referenced by qt_cleanup().

◆ repeat

bool QWindowSystemInterfacePrivate::KeyEvent::repeat

Definition at line 169 of file qwindowsysteminterface_qpa_p.h.

Referenced by qt_cleanup().

◆ repeatCount

ushort QWindowSystemInterfacePrivate::KeyEvent::repeatCount

Definition at line 170 of file qwindowsysteminterface_qpa_p.h.

Referenced by qt_cleanup().

◆ unicode

QString QWindowSystemInterfacePrivate::KeyEvent::unicode

Definition at line 168 of file qwindowsysteminterface_qpa_p.h.

Referenced by qt_cleanup().


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