You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
714 B
44 lines
714 B
#include <Windows.h>
|
|
#include <QWidget>
|
|
|
|
#include "winmousetap.h"
|
|
|
|
WinMouseTap::WinMouseTap()
|
|
{
|
|
|
|
}
|
|
|
|
WinMouseTap::~WinMouseTap()
|
|
{
|
|
|
|
}
|
|
|
|
void WinMouseTap::initMouseEventTap()
|
|
{
|
|
|
|
}
|
|
|
|
void WinMouseTap::quitMouseEventTap()
|
|
{
|
|
|
|
}
|
|
|
|
void WinMouseTap::enableMouseEventTap(QWidget *widget, bool enabled)
|
|
{
|
|
if (!widget) {
|
|
return;
|
|
}
|
|
if(enabled) {
|
|
QRect rc(widget->mapToGlobal(widget->pos())
|
|
, widget->size());
|
|
RECT mainRect;
|
|
mainRect.left = (LONG)rc.left();
|
|
mainRect.right = (LONG)rc.right();
|
|
mainRect.top = (LONG)rc.top();
|
|
mainRect.bottom = (LONG)rc.bottom();
|
|
ClipCursor(&mainRect);
|
|
} else {
|
|
ClipCursor(Q_NULLPTR);
|
|
}
|
|
}
|