Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QXcbKeyboard Class Reference

#include <qxcbkeyboard.h>

+ Inheritance diagram for QXcbKeyboard:
+ Collaboration diagram for QXcbKeyboard:

Public Member Functions

 QXcbKeyboard (QXcbConnection *connection)
 
 ~QXcbKeyboard ()
 
void initialize ()
 
void selectEvents ()
 
void handleKeyPressEvent (const xcb_key_press_event_t *event)
 
void handleKeyReleaseEvent (const xcb_key_release_event_t *event)
 
Qt::KeyboardModifiers translateModifiers (int s) const
 
void updateKeymap (xcb_mapping_notify_event_t *event)
 
void updateKeymap ()
 
QList< int > possibleKeys (const QKeyEvent *event) const
 
void updateXKBMods ()
 
xkb_mod_mask_t xkbModMask (quint16 state)
 
void updateXKBStateFromCore (quint16 state)
 
void updateXKBStateFromXI (void *modInfo, void *groupInfo)
 
int coreDeviceId () const
 
void updateXKBState (xcb_xkb_state_notify_event_t *state)
 
void handleStateChanges (xkb_state_component changedComponents)
 
- Public Member Functions inherited from QXcbObject
 QXcbObject (QXcbConnection *connection=nullptr)
 
void setConnection (QXcbConnection *connection)
 
QXcbConnectionconnection () const
 
xcb_atom_t atom (QXcbAtom::Atom atom) const
 
xcb_connection_t * xcb_connection () const
 

Protected Types

typedef QMap< xcb_keysym_t, int > KeysymModifierMap
 

Protected Member Functions

void handleKeyEvent (xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent)
 
void resolveMaskConflicts ()
 
struct xkb_keymap * keymapFromCore (const KeysymModifierMap &keysymMods)
 
void updateModifiers (const KeysymModifierMap &keysymMods)
 
KeysymModifierMap keysymsToModifiers ()
 
void updateVModMapping ()
 
void updateVModToRModMapping ()
 

Detailed Description

Definition at line 21 of file qxcbkeyboard.h.

Member Typedef Documentation

◆ KeysymModifierMap

typedef QMap<xcb_keysym_t, int> QXcbKeyboard::KeysymModifierMap
protected

Definition at line 55 of file qxcbkeyboard.h.

Constructor & Destructor Documentation

◆ QXcbKeyboard()

QXcbKeyboard::QXcbKeyboard ( QXcbConnection connection)

Definition at line 491 of file qxcbkeyboard.cpp.

References QXcbObject::connection(), QXcbBasicConnection::hasXKB(), qCWarning, selectEvents(), updateKeymap(), and QXcbObject::xcb_connection().

+ Here is the call graph for this function:

◆ ~QXcbKeyboard()

QXcbKeyboard::~QXcbKeyboard ( )

Definition at line 509 of file qxcbkeyboard.cpp.

Member Function Documentation

◆ coreDeviceId()

int QXcbKeyboard::coreDeviceId ( ) const
inline

Definition at line 44 of file qxcbkeyboard.h.

Referenced by QXcbConnection::handleXcbEvent().

+ Here is the caller graph for this function:

◆ handleKeyEvent()

void QXcbKeyboard::handleKeyEvent ( xcb_window_t  sourceWindow,
QEvent::Type  type,
xcb_keycode_t  code,
quint16  state,
xcb_timestamp_t  time,
bool  fromSendEvent 
)
protected

◆ handleKeyPressEvent()

void QXcbKeyboard::handleKeyPressEvent ( const xcb_key_press_event_t *  event)

Definition at line 913 of file qxcbkeyboard.cpp.

References e, fromSendEvent(), handleKeyEvent(), and QEvent::KeyPress.

+ Here is the call graph for this function:

◆ handleKeyReleaseEvent()

void QXcbKeyboard::handleKeyReleaseEvent ( const xcb_key_release_event_t *  event)

Definition at line 918 of file qxcbkeyboard.cpp.

References e, fromSendEvent(), handleKeyEvent(), and QEvent::KeyRelease.

+ Here is the call graph for this function:

◆ handleStateChanges()

void QXcbKeyboard::handleStateChanges ( xkb_state_component  changedComponents)

Definition at line 446 of file qxcbkeyboard.cpp.

References qCDebug.

Referenced by updateXKBState(), updateXKBStateFromCore(), and updateXKBStateFromXI().

+ Here is the caller graph for this function:

◆ initialize()

void QXcbKeyboard::initialize ( )

Definition at line 515 of file qxcbkeyboard.cpp.

References QPlatformIntegration::inputContext(), QGuiApplicationPrivate::platformIntegration(), and QXkbCommon::setXkbContext().

Referenced by QXcbIntegration::initialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ keymapFromCore()

struct xkb_keymap * QXcbKeyboard::keymapFromCore ( const KeysymModifierMap keysymMods)
protected

Definition at line 81 of file qxcbkeyboard.cpp.

References QXcbObject::connection(), QByteArray::constData(), QList< T >::constData(), getUnshiftedXKey(), i, QByteArray::isEmpty(), QList< T >::isEmpty(), QByteArray::number(), Q_XCB_REPLY, QList< T >::resize(), QXcbBasicConnection::setup(), QByteArray::size(), symbolsGroupString(), QMap< Key, T >::value(), and QXcbObject::xcb_connection().

Referenced by updateKeymap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ keysymsToModifiers()

QXcbKeyboard::KeysymModifierMap QXcbKeyboard::keysymsToModifiers ( )
protected

Definition at line 715 of file qxcbkeyboard.cpp.

References i, keycodes_contains(), map, Q_XCB_REPLY, qWarning, and QXcbObject::xcb_connection().

Referenced by updateKeymap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ possibleKeys()

QList< int > QXcbKeyboard::possibleKeys ( const QKeyEvent event) const

Definition at line 380 of file qxcbkeyboard.cpp.

References QXkbCommon::possibleKeys().

Referenced by QXcbIntegration::possibleKeys().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resolveMaskConflicts()

void QXcbKeyboard::resolveMaskConflicts ( )
protected

Definition at line 802 of file qxcbkeyboard.cpp.

Referenced by updateModifiers().

+ Here is the caller graph for this function:

◆ selectEvents()

void QXcbKeyboard::selectEvents ( )

Definition at line 521 of file qxcbkeyboard.cpp.

References error, qCWarning, select(), and QXcbObject::xcb_connection().

Referenced by QXcbKeyboard().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ translateModifiers()

QT_BEGIN_NAMESPACE Qt::KeyboardModifiers QXcbKeyboard::translateModifiers ( int  s) const

Definition at line 20 of file qxcbkeyboard.cpp.

References Qt::AltModifier, Qt::ControlModifier, Qt::GroupSwitchModifier, Qt::MetaModifier, Qt::NoModifier, ret, and Qt::ShiftModifier.

Referenced by QXcbWindow::handleButtonPressEvent(), QXcbWindow::handleButtonReleaseEvent(), handleKeyEvent(), QXcbWindow::handleMotionNotifyEvent(), QXcbWindow::handleXIMouseEvent(), and QXcbConnection::queryKeyboardModifiers().

+ Here is the caller graph for this function:

◆ updateKeymap() [1/2]

void QXcbKeyboard::updateKeymap ( )

Definition at line 332 of file qxcbkeyboard.cpp.

References QXcbObject::connection(), keymapFromCore(), keysymsToModifiers(), logLevel, qCWarning, updateModifiers(), updateXKBMods(), QXkbCommon::verifyHasLatinLayout(), and QXcbObject::xcb_connection().

Referenced by QXcbKeyboard(), and updateKeymap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateKeymap() [2/2]

void QXcbKeyboard::updateKeymap ( xcb_mapping_notify_event_t *  event)

Definition at line 323 of file qxcbkeyboard.cpp.

References QXcbObject::connection(), and updateKeymap().

Referenced by QXcbConnection::handleXcbEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateModifiers()

void QXcbKeyboard::updateModifiers ( const KeysymModifierMap keysymMods)
protected

Definition at line 683 of file qxcbkeyboard.cpp.

References applyModifier(), QXcbObject::connection(), resolveMaskConflicts(), updateVModMapping(), updateVModToRModMapping(), and QMap< Key, T >::value().

Referenced by updateKeymap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateVModMapping()

void QXcbKeyboard::updateVModMapping ( )
protected

Definition at line 555 of file qxcbkeyboard.cpp.

References QXcbBasicConnection::atomName(), QXcbObject::connection(), QByteArray::data(), Q_XCB_REPLY, qstrcmp(), qWarning, and QXcbObject::xcb_connection().

Referenced by updateModifiers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateVModToRModMapping()

void QXcbKeyboard::updateVModToRModMapping ( )
protected

Definition at line 616 of file qxcbkeyboard.cpp.

References map, Q_XCB_REPLY, qWarning, and QXcbObject::xcb_connection().

Referenced by updateModifiers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateXKBMods()

void QXcbKeyboard::updateXKBMods ( )

Definition at line 479 of file qxcbkeyboard.cpp.

References XKB_MOD_NAME_CTRL, and XKB_MOD_NAME_SHIFT.

Referenced by updateKeymap().

+ Here is the caller graph for this function:

◆ updateXKBState()

void QXcbKeyboard::updateXKBState ( xcb_xkb_state_notify_event_t *  state)

Definition at line 385 of file qxcbkeyboard.cpp.

References QXcbObject::connection(), handleStateChanges(), and state.

Referenced by QXcbConnection::handleXcbEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateXKBStateFromCore()

void QXcbKeyboard::updateXKBStateFromCore ( quint16  state)

Definition at line 406 of file qxcbkeyboard.cpp.

References handleStateChanges(), lockedGroup(), state, and xkbModMask().

Referenced by QXcbConnection::handleXcbEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateXKBStateFromXI()

void QXcbKeyboard::updateXKBStateFromXI ( void modInfo,
void groupInfo 
)

Definition at line 428 of file qxcbkeyboard.cpp.

References handleStateChanges().

Referenced by QXcbWindow::handleXIEnterLeave(), and QXcbWindow::handleXIMouseEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xkbModMask()

xkb_mod_mask_t QXcbKeyboard::xkbModMask ( quint16  state)

Definition at line 455 of file qxcbkeyboard.cpp.

References state.

Referenced by handleKeyEvent(), and updateXKBStateFromCore().

+ Here is the caller graph for this function:

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