Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwindowstabletsupport.cpp File Reference

(64e1744a579b50a19cda2433094a4fc9b8ed61ba)

#include "qwindowstabletsupport.h"
#include "qwindowscontext.h"
#include "qwindowskeymapper.h"
#include "qwindowswindow.h"
#include "qwindowsscreen.h"
#include <qpa/qwindowsysteminterface.h>
#include <QtGui/qevent.h>
#include <QtGui/qscreen.h>
#include <QtGui/qguiapplication.h>
#include <QtGui/qwindow.h>
#include <QtCore/qdebug.h>
#include <QtCore/qvarlengtharray.h>
#include <QtCore/qmath.h>
#include <private/qguiapplication_p.h>
#include <QtCore/private/qsystemlibrary_p.h>
#include <pktdef.h>
+ Include dependency graph for qwindowstabletsupport.cpp:

Go to the source code of this file.

Macros

#define PACKETDATA   (PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE | PK_ORIENTATION | PK_CURSOR | PK_Z | PK_TIME)
 

Enumerations

enum  { PacketMode = 0 , TabletPacketQSize = 128 , DeviceIdMask = 0xFF6 , CursorTypeBitMask = 0x0F06 }
 

Functions

LRESULT QT_WIN_CALLBACK qWindowsTabletSupportWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static int sign (int x)
 
template<class Stream >
static void formatOptions (Stream &str, unsigned options)
 
QDebug operator<< (QDebug d, const QWindowsTabletDeviceData &t)
 
QDebug operator<< (QDebug d, const LOGCONTEXT &lc)
 
QWinTabPointingDevicecreateInputDevice (const QSharedPointer< QWindowsTabletDeviceData > &d, QInputDevice::DeviceType devType, QPointingDevice::PointerType pointerType)
 
static QInputDevice::DeviceType deviceType (const UINT cursorType)
 
static QPointingDevice::PointerType pointerType (unsigned currentCursor)
 
Qt::MouseButton buttonValueToEnum (DWORD button, const QWindowsTabletDeviceData &tdd)
 
Qt::MouseButtons convertTabletButtons (DWORD btnNew, const QWindowsTabletDeviceData &tdd)
 

Macro Definition Documentation

◆ PACKETDATA

#define PACKETDATA   (PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE | PK_ORIENTATION | PK_CURSOR | PK_Z | PK_TIME)

Definition at line 25 of file qwindowstabletsupport.cpp.

Referenced by QWindowsTabletSupport::create().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PacketMode 
TabletPacketQSize 
DeviceIdMask 
CursorTypeBitMask 

Definition at line 30 of file qwindowstabletsupport.cpp.

Function Documentation

◆ buttonValueToEnum()

Qt::MouseButton buttonValueToEnum ( DWORD button,
const QWindowsTabletDeviceData & tdd )

Definition at line 522 of file qwindowstabletsupport.cpp.

References button, Qt::LeftButton, Qt::MiddleButton, Qt::NoButton, and Qt::RightButton.

Referenced by convertTabletButtons().

+ Here is the caller graph for this function:

◆ convertTabletButtons()

Qt::MouseButtons convertTabletButtons ( DWORD btnNew,
const QWindowsTabletDeviceData & tdd )

If a button that is present in hardware input is mapped to a Qt::NoButton, it means that it is going to be eaten by the driver, for example by its "Pan/Scroll" feature. Therefore we shouldn't handle any of the events associated to it. We'll just return Qt::NoButtons here.

Definition at line 542 of file qwindowstabletsupport.cpp.

References btn, buttonValueToEnum(), i, and Qt::NoButton.

Referenced by QWindowsTabletSupport::translateTabletPacketEvent().

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

◆ createInputDevice()

Definition at line 132 of file qwindowstabletsupport.cpp.

References d, QPointingDeviceUniqueId::fromNumericId(), QInputDevice::Hover, QInputDevice::MouseEmulation, pointerType(), QInputDevice::Position, QInputDevice::Pressure, QStringLiteral, QWindowSystemInterface::registerInputDevice(), QInputDevice::Rotation, QInputDevice::systemId, QInputDevice::TangentialPressure, QInputDevice::XTilt, QInputDevice::YTilt, and QInputDevice::ZPosition.

Referenced by QWindowsTabletSupport::translateTabletProximityEvent().

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

◆ deviceType()

◆ formatOptions()

template<class Stream >
static void formatOptions ( Stream & str,
unsigned options )
static

Definition at line 79 of file qwindowstabletsupport.cpp.

References str.

Referenced by QWindowsTabletSupport::description(), and operator<<().

+ Here is the caller graph for this function:

◆ operator<<() [1/2]

QDebug operator<< ( QDebug d,
const LOGCONTEXT & lc )

Definition at line 107 of file qwindowstabletsupport.cpp.

References d, Qt::dec(), formatOptions(), QString::fromWCharArray(), and Qt::hex().

+ Here is the call graph for this function:

◆ operator<<() [2/2]

QDebug operator<< ( QDebug d,
const QWindowsTabletDeviceData & t )

Definition at line 96 of file qwindowstabletsupport.cpp.

References d.

◆ pointerType()

◆ qWindowsTabletSupportWndProc()

LRESULT QT_WIN_CALLBACK qWindowsTabletSupportWndProc ( HWND hwnd,
UINT message,
WPARAM wParam,
LPARAM lParam )

Definition at line 37 of file qwindowstabletsupport.cpp.

References QWindowsContext::instance().

Referenced by QWindowsTabletSupport::create().

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

◆ sign()