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
QWindowsMouseHandler Class Reference

Windows mouse handler. More...

#include <qwindowsmousehandler.h>

+ Collaboration diagram for QWindowsMouseHandler:

Public Types

using QPointingDevicePtr = QSharedPointer<QPointingDevice>
 

Public Member Functions

 QWindowsMouseHandler ()
 
const QPointingDevicePtrtouchDevice () const
 
void setTouchDevice (const QPointingDevicePtr &d)
 
bool translateMouseEvent (QWindow *widget, HWND hwnd, QtWindows::WindowsEventType t, MSG msg, LRESULT *result)
 
bool translateTouchEvent (QWindow *widget, HWND hwnd, QtWindows::WindowsEventType t, MSG msg, LRESULT *result)
 
bool translateGestureEvent (QWindow *window, HWND hwnd, QtWindows::WindowsEventType, MSG msg, LRESULT *)
 
bool translateScrollEvent (QWindow *window, HWND hwnd, MSG msg, LRESULT *result)
 
QWindowwindowUnderMouse () const
 
void clearWindowUnderMouse ()
 
void clearEvents ()
 

Static Public Member Functions

static Qt::MouseButtons keyStateToMouseButtons (WPARAM)
 
static Qt::KeyboardModifiers keyStateToModifiers (int)
 
static int mouseButtonsToKeyState (Qt::MouseButtons)
 
static Qt::MouseButtons queryMouseButtons ()
 
static const QPointingDeviceprimaryMouse ()
 

Detailed Description

Windows mouse handler.

Dispatches mouse and touch events. Separate for code cleanliness.

Definition at line 20 of file qwindowsmousehandler.h.

Member Typedef Documentation

◆ QPointingDevicePtr

Constructor & Destructor Documentation

◆ QWindowsMouseHandler()

QWindowsMouseHandler::QWindowsMouseHandler ( )
default

Member Function Documentation

◆ clearEvents()

void QWindowsMouseHandler::clearEvents ( )

Definition at line 104 of file qwindowsmousehandler.cpp.

References Qt::NoButton, and QEvent::None.

◆ clearWindowUnderMouse()

void QWindowsMouseHandler::clearWindowUnderMouse ( )
inline

Definition at line 49 of file qwindowsmousehandler.h.

Referenced by QWindowsContext::clearWindowUnderMouse().

+ Here is the caller graph for this function:

◆ keyStateToModifiers()

Qt::KeyboardModifiers QWindowsMouseHandler::keyStateToModifiers ( int wParam)
inlinestatic

◆ keyStateToMouseButtons()

Qt::MouseButtons QWindowsMouseHandler::keyStateToMouseButtons ( WPARAM wParam)
inlinestatic

Definition at line 69 of file qwindowsmousehandler.h.

References Qt::LeftButton, Qt::MiddleButton, Qt::NoButton, Qt::RightButton, Qt::XButton1, and Qt::XButton2.

Referenced by translateMouseEvent().

+ Here is the caller graph for this function:

◆ mouseButtonsToKeyState()

int QWindowsMouseHandler::mouseButtonsToKeyState ( Qt::MouseButtons mb)
inlinestatic

◆ primaryMouse()

const QPointingDevice * QWindowsMouseHandler::primaryMouse ( )
static

Definition at line 96 of file qwindowsmousehandler.cpp.

References QPointingDevice::primaryPointingDevice().

Referenced by translateMouseEvent(), and QWindowsPointerHandler::translateMouseEvent().

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

◆ queryMouseButtons()

Qt::MouseButtons QWindowsMouseHandler::queryMouseButtons ( )
static

Definition at line 110 of file qwindowsmousehandler.cpp.

References Qt::LeftButton, Qt::MiddleButton, Qt::RightButton, Qt::XButton1, and Qt::XButton2.

Referenced by QWindowsOleDropTarget::DragLeave(), QWindowsOleDropSource::QueryContinueDrag(), and translateMouseEvent().

+ Here is the caller graph for this function:

◆ setTouchDevice()

void QWindowsMouseHandler::setTouchDevice ( const QPointingDevicePtr & d)
inline

Definition at line 29 of file qwindowsmousehandler.h.

References d.

Referenced by QWindowsContext::initTouch().

+ Here is the caller graph for this function:

◆ touchDevice()

const QPointingDevicePtr & QWindowsMouseHandler::touchDevice ( ) const
inline

Definition at line 28 of file qwindowsmousehandler.h.

Referenced by QWindowsContextPrivate::QWindowsContextPrivate(), and QWindowsContext::initTouch().

+ Here is the caller graph for this function:

◆ translateGestureEvent()

bool QWindowsMouseHandler::translateGestureEvent ( QWindow * window,
HWND hwnd,
QtWindows::WindowsEventType ,
MSG msg,
LRESULT *  )

Definition at line 643 of file qwindowsmousehandler.cpp.

References Q_UNUSED, and window().

Referenced by QWindowsContext::windowsProc().

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

◆ translateMouseEvent()

bool QWindowsMouseHandler::translateMouseEvent ( QWindow * widget,
HWND hwnd,
QtWindows::WindowsEventType t,
MSG msg,
LRESULT * result )

Definition at line 206 of file qwindowsmousehandler.cpp.

References QWindowsWindow::AutoMouseCapture, compressMouseMove(), QSharedPointer< T >::data(), device, QWindowsIntegration::DontPassOsMouseEventsSynthesizedFromTouch, eventFromMsg(), QWindowSystemInterface::flushWindowSystemEvents(), QGuiApplication::focusWindow(), QWindowSystemInterface::handleEnterEvent(), QWindowSystemInterface::handleLeaveEvent(), QWindowSystemInterface::handleMouseEvent(), QWindowsContext::instance(), QWindowsIntegration::instance(), QPointer< T >::isNull(), QSharedPointer< T >::isNull(), QWindowsBaseWindow::isRtlLayout(), keyStateToMouseButtons(), lastMouseMovePos, Qt::LeftButton, QWindowsGeometryHint::mapFromGlobal(), QWindowsGeometryHint::mapToGlobal(), QEvent::MouseButtonDblClick, QEvent::MouseButtonPress, QEvent::MouseButtonRelease, Qt::MouseEventNotSynthesized, Qt::MouseEventSynthesizedBySystem, QEvent::MouseMove, QtWindows::MouseWheelEvent, QEvent::NonClientAreaMouseButtonDblClick, QEvent::NonClientAreaMouseButtonPress, QEvent::NonClientAreaMouseButtonRelease, QEvent::NonClientAreaMouseMove, QtWindows::NonClientEventFlag, QEvent::None, primaryMouse(), qCDebug, queryMouseButtons(), qWarning, Event::type, window(), QWindowsScreen::windowAt(), QWindowsWindow::windowsWindowOf(), and Qt::WindowTransparentForInput.

Referenced by QWindowsContext::windowsProc().

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

◆ translateScrollEvent()

bool QWindowsMouseHandler::translateScrollEvent ( QWindow * window,
HWND hwnd,
MSG msg,
LRESULT * result )

Definition at line 528 of file qwindowsmousehandler.cpp.

References Qt::Horizontal, Qt::NoModifier, QCursor::pos(), redirectWheelEvent(), and window().

Referenced by QWindowsContext::windowsProc().

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

◆ translateTouchEvent()

bool QWindowsMouseHandler::translateTouchEvent ( QWindow * widget,
HWND hwnd,
QtWindows::WindowsEventType t,
MSG msg,
LRESULT * result )

Definition at line 560 of file qwindowsmousehandler.cpp.

References QHash< Key, T >::clear(), QHash< Key, T >::contains(), QSharedPointer< T >::data(), QScreen::geometry, QWindowSystemInterface::handleTouchEvent(), QRect::height(), i, QHash< Key, T >::insert(), QWindowsContext::instance(), QEventPoint::Pressed, QGuiApplication::primaryScreen, qWarning, QEventPoint::Released, QHash< Key, T >::remove(), screen, QHash< Key, T >::size(), QEventPoint::Stationary, QEventPoint::Updated, QHash< Key, T >::value(), QRect::width(), window(), QPointF::x(), and QPointF::y().

Referenced by QWindowsContext::windowsProc().

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

◆ windowUnderMouse()

QWindow * QWindowsMouseHandler::windowUnderMouse ( ) const
inline

Definition at line 48 of file qwindowsmousehandler.h.

References QPointer< T >::data().

Referenced by QWindowsContext::windowUnderMouse().

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

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