Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/gui/src/ServerConfig.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ bool ServerConfig::operator==(const ServerConfig &sc) const
m_SwitchCornerSize == sc.m_SwitchCornerSize && m_SwitchCorners == sc.m_SwitchCorners &&
m_Hotkeys == sc.m_Hotkeys && m_pAppConfig == sc.m_pAppConfig &&
m_DisableLockToScreen == sc.m_DisableLockToScreen && m_ClipboardSharing == sc.m_ClipboardSharing &&
m_ClipboardSharingSize == sc.m_ClipboardSharingSize && m_pMainWindow == sc.m_pMainWindow;
m_ClipboardSharingSize == sc.m_ClipboardSharingSize && m_TouchInputLocal == sc.m_TouchInputLocal &&
m_pMainWindow == sc.m_pMainWindow;
}

void ServerConfig::save(QFile &file) const
Expand Down Expand Up @@ -127,6 +128,7 @@ void ServerConfig::commit()
settings().setValue("disableLockToScreen", disableLockToScreen());
settings().setValue("clipboardSharing", clipboardSharing());
settings().setValue("clipboardSharingSize", QVariant::fromValue(clipboardSharingSize()));
settings().setValue("touchInputLocal", touchInputLocal());

if (!getClientAddress().isEmpty()) {
settings().setValue("clientAddress", getClientAddress());
Expand Down Expand Up @@ -182,6 +184,7 @@ void ServerConfig::recall()
settings().value("clipboardSharingSize", (int)ServerConfig::defaultClipboardSharingSize()).toULongLong()
);
setClipboardSharing(settings().value("clipboardSharing", true).toBool());
setTouchInputLocal(settings().value("touchInputLocal", false).toBool());
setClientAddress(settings().value("clientAddress", "").toString());

readSettings(settings(), switchCorners(), "switchCorner", 0, static_cast<int>(NumSwitchCorners));
Expand Down Expand Up @@ -216,6 +219,9 @@ void ServerConfig::recall()
if (locked.contains("clipboardSharingSize")) {
m_ClipboardSharingSize = locked.value("clipboardSharingSize").toULongLong();
}
if (locked.contains("touchInputLocal")) {
m_TouchInputLocal = locked.value("touchInputLocal").toBool();
}
locked.endGroup();
}

Expand Down Expand Up @@ -286,6 +292,8 @@ QTextStream &operator<<(QTextStream &outStream, const ServerConfig &config)
<< "clipboardSharing = " << (config.clipboardSharing() ? "true" : "false") << Qt::endl;
outStream << "\t"
<< "clipboardSharingSize = " << config.clipboardSharingSize() << Qt::endl;
outStream << "\t"
<< "touchInputLocal = " << (config.touchInputLocal() ? "true" : "false") << Qt::endl;

if (!config.getClientAddress().isEmpty()) {
outStream << "\t"
Expand Down
9 changes: 9 additions & 0 deletions src/gui/src/ServerConfig.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ class ServerConfig : public ScreenConfig, public deskflow::gui::IServerConfig
{
return m_ClipboardSharingSize;
}
bool touchInputLocal() const
{
return m_TouchInputLocal;
}
static size_t defaultClipboardSharingSize();

//
Expand Down Expand Up @@ -224,6 +228,10 @@ class ServerConfig : public ScreenConfig, public deskflow::gui::IServerConfig
{
m_ClipboardSharing = on;
}
void setTouchInputLocal(bool on)
{
m_TouchInputLocal = on;
}
void setConfigFile(const QString &configFile);
void setUseExternalConfig(bool useExternalConfig);
size_t setClipboardSharingSize(size_t size);
Expand Down Expand Up @@ -253,6 +261,7 @@ class ServerConfig : public ScreenConfig, public deskflow::gui::IServerConfig
int m_SwitchCornerSize = 0;
bool m_DisableLockToScreen = false;
bool m_ClipboardSharing = true;
bool m_TouchInputLocal = false;
QString m_ClientAddress = "";
QList<bool> m_SwitchCorners;
HotkeyList m_Hotkeys;
Expand Down
13 changes: 13 additions & 0 deletions src/gui/src/ServerConfigDialog.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ ServerConfigDialog::ServerConfigDialog(QWidget *parent, ServerConfig &config, Ap
int clipboardSharingSizeM = static_cast<int>(serverConfig().clipboardSharingSize() / 1024);
m_pSpinBoxClipboardSizeLimit->setValue(clipboardSharingSizeM);
m_pSpinBoxClipboardSizeLimit->setEnabled(serverConfig().clipboardSharing());
m_pCheckBoxTouchInputLocal->setChecked(serverConfig().touchInputLocal());

foreach (const Hotkey &hotkey, serverConfig().hotkeys())
m_pListHotkeys->addItem(hotkey.text());
Expand Down Expand Up @@ -105,6 +106,10 @@ ServerConfigDialog::ServerConfigDialog(QWidget *parent, ServerConfig &config, Ap
qDebug() << "locking clipboard size setting";
m_pSpinBoxClipboardSizeLimit->setEnabled(false);
}
if (locked.contains("touchInputLocal")) {
qDebug() << "locking touch input local setting";
m_pCheckBoxTouchInputLocal->setEnabled(false);
}
locked.endGroup();

onChange();
Expand Down Expand Up @@ -142,6 +147,10 @@ ServerConfigDialog::ServerConfigDialog(QWidget *parent, ServerConfig &config, Ap
serverConfig().setDisableLockToScreen(v);
onChange();
});
connect(m_pCheckBoxTouchInputLocal, &QCheckBox::stateChanged, this, [this](const int &v) {
serverConfig().setTouchInputLocal(v);
onChange();
});
Comment on lines +150 to +153
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checkbox has two signal connections (stateChanged at line 150 and checkStateChanged at line 204) that both call setTouchInputLocal. This will cause the setting to be updated twice for each user interaction. Remove one of these duplicate connections.

Suggested change
connect(m_pCheckBoxTouchInputLocal, &QCheckBox::stateChanged, this, [this](const int &v) {
serverConfig().setTouchInputLocal(v);
onChange();
});

Copilot uses AI. Check for mistakes.
connect(m_pCheckBoxCornerTopLeft, &QCheckBox::stateChanged, this, [this](const int &v) {
serverConfig().setSwitchCorner(static_cast<int>(TopLeft), v);
onChange();
Expand Down Expand Up @@ -192,6 +201,10 @@ ServerConfigDialog::ServerConfigDialog(QWidget *parent, ServerConfig &config, Ap
serverConfig().setDisableLockToScreen(v == Qt::Checked);
onChange();
});
connect(m_pCheckBoxTouchInputLocal, &QCheckBox::checkStateChanged, this, [this](const Qt::CheckState &v) {
serverConfig().setTouchInputLocal(v == Qt::Checked);
onChange();
});
connect(m_pCheckBoxCornerTopLeft, &QCheckBox::checkStateChanged, this, [this](const Qt::CheckState &v) {
serverConfig().setSwitchCorner(static_cast<int>(TopLeft), v == Qt::Checked);
onChange();
Expand Down
10 changes: 10 additions & 0 deletions src/gui/src/ServerConfigDialogBase.ui
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,16 @@
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="m_pCheckBoxTouchInputLocal">
<property name="text">
<string>Keep touch input on this computer</string>
</property>
<property name="toolTip">
<string>When enabled, touch screen input stays on this computer even when the cursor moves to another screen</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
Expand Down
1 change: 1 addition & 0 deletions src/lib/deskflow/option_types.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ static const OptionID kOptionWin32KeepForeground = OPTION_CODE("_KFW");
static const OptionID kOptionDisableLockToScreen = OPTION_CODE("DLTS");
static const OptionID kOptionClipboardSharing = OPTION_CODE("CLPS");
static const OptionID kOptionClipboardSharingSize = OPTION_CODE("CLSZ");
static const OptionID kOptionTouchInputLocal = OPTION_CODE("TILC");
//@}

//! @name Screen switch corner enumeration
Expand Down
30 changes: 30 additions & 0 deletions src/lib/platform/MSWindowsHook.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ static BYTE g_keyState[256] = {0};
static DWORD g_hookThread = 0;
static bool g_fakeServerInput = false;
static BOOL g_isPrimary = TRUE;
static bool g_touchInputLocal = false;
static bool g_isOnScreen = true;

// Touch input signature in dwExtraInfo (bit 7 set indicates touch/pen)
#define TOUCH_SIGNATURE_MASK 0xFFFFFF00
#define TOUCH_SIGNATURE 0xFF515700
Comment on lines +51 to +52
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define TOUCH_SIGNATURE_MASK 0xFFFFFF00
#define TOUCH_SIGNATURE 0xFF515700
static const DWORD kTouchInputSignatureMask = 0xFFFFFF00;
static const DWORD kTouchInputSignature = 0xFF515700;

Why static const instead of #define: You'll see #define all over older code - it's a habit from C, where it was the only option. But C++ has better tools now. Think of #define like a dumb find-and-replace - it just swaps the name for the value everywhere, with no understanding of what it means. If something goes wrong, error messages are confusing and debuggers won't show you the name. Using static const creates something the compiler actually understands, so you get clearer errors and can see the name when troubleshooting. New code should use the better approach, even if older code doesn't.

Why mouseFromTouchInput instead of something vague: "Touch signature" makes you think "touch what?" But "mouse from touch input" tells you right away it's about mouse events generated by touchscreen/touchpad input. Good names mean you don't have to hunt through surrounding code to figure out what something means.


MSWindowsHook::MSWindowsHook()
{
Expand Down Expand Up @@ -148,6 +154,17 @@ void MSWindowsHook::setMode(EHookMode mode)
g_mode = mode;
}

void MSWindowsHook::setTouchInputLocal(bool enable)
{
g_touchInputLocal = enable;
LOG((CLOG_DEBUG "hook: touchInputLocal = %s", enable ? "true" : "false"));
}

void MSWindowsHook::setIsOnScreen(bool onScreen)
{
g_isOnScreen = onScreen;
}

static void keyboardGetState(BYTE keys[256], DWORD vkCode, bool kf_up)
{
// we have to use GetAsyncKeyState() rather than GetKeyState() because
Expand Down Expand Up @@ -585,6 +602,19 @@ static LRESULT CALLBACK mouseLLHook(int code, WPARAM wParam, LPARAM lParam)
return CallNextHookEx(g_mouseLL, code, wParam, lParam);
}

// Check if this mouse event was generated from touch input
// Touch input has a specific signature in dwExtraInfo
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The touch signature detection relies on an undocumented Windows implementation detail (dwExtraInfo signature 0xFF515700). Consider adding a comment explaining this is a known Windows pattern for touch-generated mouse events, and noting that this may not work reliably across all hardware or future Windows versions.

Suggested change
// Touch input has a specific signature in dwExtraInfo
// Touch input has a specific signature in dwExtraInfo
// NOTE: The TOUCH_SIGNATURE* values are based on an undocumented Windows
// implementation detail (dwExtraInfo signature 0xFF515700) that is commonly
// used to identify touch-generated mouse events. This heuristic may not work
// reliably across all hardware or future Windows versions.

Copilot uses AI. Check for mistakes.
bool isTouchGenerated = ((info->dwExtraInfo & TOUCH_SIGNATURE_MASK) == TOUCH_SIGNATURE);

// If touchInputLocal is enabled and cursor is on client screen,
// let the touch event work locally but don't forward it to the client
if (g_touchInputLocal && !g_isOnScreen && isTouchGenerated) {
LOG((CLOG_DEBUG "touch event - processing locally, not forwarding to client"));
// Don't call mouseHookHandler - this skips forwarding to client
// Don't return 1 - this lets the event proceed to local applications
return CallNextHookEx(g_mouseLL, code, wParam, lParam);
}
Comment on lines +605 to +616
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Check if this mouse event was generated from touch input
// Touch input has a specific signature in dwExtraInfo
bool isTouchGenerated = ((info->dwExtraInfo & TOUCH_SIGNATURE_MASK) == TOUCH_SIGNATURE);
// If touchInputLocal is enabled and cursor is on client screen,
// let the touch event work locally but don't forward it to the client
if (g_touchInputLocal && !g_isOnScreen && isTouchGenerated) {
LOG((CLOG_DEBUG "touch event - processing locally, not forwarding to client"));
// Don't call mouseHookHandler - this skips forwarding to client
// Don't return 1 - this lets the event proceed to local applications
return CallNextHookEx(g_mouseLL, code, wParam, lParam);
}
// touch gestures don't translate well to remote clients, so optionally keep them local
bool const mouseFromTouchInput = (info->dwExtraInfo & TOUCH_SIGNATURE_MASK) == TOUCH_SIGNATURE;
if (g_touchInputLocal && !g_isOnScreen && mouseFromTouchInput) {
LOG((CLOG_DEBUG1 "touch-generated mouse event, keeping input on server"));
return CallNextHookEx(g_mouseLL, code, wParam, lParam);
}

When you pick descriptive variable names like mouseFromTouchInput, the code starts to read like a sentence - so you don't need a comment above it saying the same thing. That frees you up to use comments for the stuff that isn't obvious from the code, like why this feature exists in the first place. It's a handy trick that makes code easier to follow and means fewer comments to keep up to date.

Also, log level CLOG_DEBUG1 might be better. I noticed that this long line is very noisy as it happens on every mouse event and for those kinds of noisy log lines we push them to the higher log levels.


SInt32 x = static_cast<SInt32>(info->pt.x);
SInt32 y = static_cast<SInt32>(info->pt.y);
SInt32 w = static_cast<SInt16>(HIWORD(info->mouseData));
Expand Down
6 changes: 6 additions & 0 deletions src/lib/platform/MSWindowsHook.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,10 @@ class MSWindowsHook
static int installScreenSaver();

static int uninstallScreenSaver();

//! Set whether touch input should stay on this computer
void setTouchInputLocal(bool enable);

//! Set whether cursor is currently on this screen
void setIsOnScreen(bool onScreen);
};
104 changes: 103 additions & 1 deletion src/lib/platform/MSWindowsScreen.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "platform/MSWindowsScreen.h"

#include "arch/Arch.h"
#include "deskflow/option_types.h"
#include "arch/win32/ArchMiscWindows.h"
#include "base/IEventQueue.h"
#include "base/Log.h"
Expand Down Expand Up @@ -83,6 +84,28 @@
#define PBT_APMRESUMEAUTOMATIC 0x0012
#endif

// WM_POINTER stuff (Windows 8+)
#if !defined(WM_POINTERDOWN)
#define WM_POINTERDOWN 0x0246
#define WM_POINTERUP 0x0247
#define WM_POINTERUPDATE 0x0245
#define WM_POINTERENTER 0x0249
#define WM_POINTERLEAVE 0x024A
#define GET_POINTERID_WPARAM(wParam) (LOWORD(wParam))
#endif

#if !defined(PT_POINTER)
#define PT_POINTER 1
#define PT_TOUCH 2
#define PT_PEN 3
#define PT_MOUSE 4
#endif
Comment on lines +87 to +102
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// WM_POINTER stuff (Windows 8+)
#if !defined(WM_POINTERDOWN)
#define WM_POINTERDOWN 0x0246
#define WM_POINTERUP 0x0247
#define WM_POINTERUPDATE 0x0245
#define WM_POINTERENTER 0x0249
#define WM_POINTERLEAVE 0x024A
#define GET_POINTERID_WPARAM(wParam) (LOWORD(wParam))
#endif
#if !defined(PT_POINTER)
#define PT_POINTER 1
#define PT_TOUCH 2
#define PT_PEN 3
#define PT_MOUSE 4
#endif

These #if !defined guards aren't needed because we only target Windows 10+ with a modern SDK. These constants (WM_POINTERDOWN, PT_TOUCH, etc.) are already defined in the SDK.

If added by an LLM, it's because they tend to be overly defensive. LLMs are trained on lots of older code that needed these compatibility shims, so they often add them "just in case" without considering the actual build environment. It's a common pattern: the LLM doesn't know your minimum SDK version, so it hedges by including fallbacks that were necessary 10 years ago but are now just noise.

When using an LLM to generate code, watch for this kind of unnecessary defensiveness; legacy patterns copied without understanding the current context.


// Function pointer type for GetPointerType (loaded dynamically for Win7 compat)
typedef BOOL(WINAPI *GetPointerTypeFunc)(UINT32 pointerId, DWORD *pointerType);
static GetPointerTypeFunc s_getPointerType = NULL;
static bool s_pointerApiChecked = false;
Comment on lines +104 to +107
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Function pointer type for GetPointerType (loaded dynamically for Win7 compat)
typedef BOOL(WINAPI *GetPointerTypeFunc)(UINT32 pointerId, DWORD *pointerType);
static GetPointerTypeFunc s_getPointerType = NULL;
static bool s_pointerApiChecked = false;

This backward compatibility for Windows 8 is likely redundant.


//
// MSWindowsScreen
//
Expand Down Expand Up @@ -124,7 +147,9 @@ MSWindowsScreen::MSWindowsScreen(
m_hasMouse(GetSystemMetrics(SM_MOUSEPRESENT) != 0),
m_events(events),
m_dropWindow(NULL),
m_dropWindowSize(20)
m_dropWindowSize(20),
m_touchInputLocal(false),
m_lastInputWasTouch(false)
{
LOG_DEBUG("settting up %s screen", m_isPrimary ? "primary" : "secondary");

Expand Down Expand Up @@ -313,6 +338,7 @@ void MSWindowsScreen::enter()

// now on screen
m_isOnScreen = true;
m_hook.setIsOnScreen(true);
setupMouseKeys();
}

Expand Down Expand Up @@ -369,6 +395,7 @@ void MSWindowsScreen::leave()

// now off screen
m_isOnScreen = false;
m_hook.setIsOnScreen(false);

if (isDraggingStarted() && !m_isPrimary) {
m_sendDragThread = new Thread(new TMethodJob<MSWindowsScreen>(this, &MSWindowsScreen::sendDragThread));
Expand Down Expand Up @@ -475,6 +502,16 @@ void MSWindowsScreen::resetOptions()

void MSWindowsScreen::setOptions(const OptionsList &options)
{
// Handle touch input local option
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Handle touch input local option

for (UInt32 i = 0, n = (UInt32)options.size(); i < n; i += 2) {
if (options[i] == kOptionTouchInputLocal) {
m_touchInputLocal = (options[i + 1] != 0);
LOG((CLOG_DEBUG1 "touchInputLocal = %s", m_touchInputLocal ? "true" : "false"));
// Update the hook so it can block touch-generated mouse events
m_hook.setTouchInputLocal(m_touchInputLocal);
}
}

m_desks->setOptions(options);
}

Expand Down Expand Up @@ -1043,6 +1080,19 @@ bool MSWindowsScreen::onEvent(HWND, UINT msg, WPARAM wParam, LPARAM lParam, LRES
case WM_DISPLAYCHANGE:
return onDisplayChange();

// Handle pointer input (touch/pen) - Windows 8+
// This allows us to detect touch vs mouse input and optionally keep touch local
Comment on lines +1083 to +1084
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Handle pointer input (touch/pen) - Windows 8+
// This allows us to detect touch vs mouse input and optionally keep touch local

case WM_POINTERDOWN:
case WM_POINTERUP:
case WM_POINTERUPDATE:
if (m_isPrimary && onPointerInput(wParam, lParam)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (m_isPrimary && onPointerInput(wParam, lParam)) {
if (m_isPrimary && m_touchInputLocal) {

Perhaps I'm missing something, but I tried just using m_touchInputLocal directly rather than the new onPointerInput function, and it still seems to solve the problem. Are the onPointerInput and isPointerTypeTouch functions redundant?

// Touch input was consumed (kept local)
*result = 0;
return true;
}
// Fall through to let DefWindowProc convert to mouse messages
return false;

/* On windows 10 we don't receive WM_POWERBROADCAST after sleep.
We receive only WM_TIMECHANGE hence this message is used to resume.*/
case WM_TIMECHANGE:
Expand Down Expand Up @@ -1378,6 +1428,58 @@ bool MSWindowsScreen::onMouseWheel(SInt32 xDelta, SInt32 yDelta)
return true;
}

bool MSWindowsScreen::isPointerTypeTouch(UINT32 pointerId) const
{
// Dynamically load GetPointerType for Windows 7 compatibility
if (!s_pointerApiChecked) {
s_pointerApiChecked = true;
HMODULE user32 = GetModuleHandle("user32.dll");
if (user32 != NULL) {
s_getPointerType = (GetPointerTypeFunc)GetProcAddress(user32, "GetPointerType");
}
}

if (s_getPointerType == NULL) {
// API not available (Windows 7 or earlier)
return false;
}

DWORD pointerType = PT_POINTER;
if (s_getPointerType(pointerId, &pointerType)) {
Comment on lines +1433 to +1448
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Dynamically load GetPointerType for Windows 7 compatibility
if (!s_pointerApiChecked) {
s_pointerApiChecked = true;
HMODULE user32 = GetModuleHandle("user32.dll");
if (user32 != NULL) {
s_getPointerType = (GetPointerTypeFunc)GetProcAddress(user32, "GetPointerType");
}
}
if (s_getPointerType == NULL) {
// API not available (Windows 7 or earlier)
return false;
}
DWORD pointerType = PT_POINTER;
if (s_getPointerType(pointerId, &pointerType)) {
if (GetPointerType(pointerId, &pointerType)) {

We can probably just call the function directly.

return (pointerType == PT_TOUCH || pointerType == PT_PEN);
}
return false;
}

bool MSWindowsScreen::onPointerInput(WPARAM wParam, LPARAM lParam)
{
UINT32 pointerId = GET_POINTERID_WPARAM(wParam);

LOG((CLOG_DEBUG "onPointerInput: pointerId=%d, touchInputLocal=%s, isOnScreen=%s",
pointerId, m_touchInputLocal ? "true" : "false", m_isOnScreen ? "true" : "false"));

// Check if this is touch/pen input
if (isPointerTypeTouch(pointerId)) {
m_lastInputWasTouch = true;
LOG((CLOG_DEBUG "pointer is touch input"));

// If touchInputLocal is enabled and cursor is on another screen,
// consume the event so it stays local
if (m_touchInputLocal && !m_isOnScreen) {
LOG((CLOG_INFO "touch input kept local (cursor on client screen)"));
// Return true to indicate we handled it - this prevents
// DefWindowProc from converting it to mouse input
return true;
}
} else {
m_lastInputWasTouch = false;
}

// Let the system handle the pointer input normally
// It will be converted to mouse messages and caught by our hook
return false;
}

bool MSWindowsScreen::onScreensaver(bool activated)
{
// ignore this message if there are any other screen saver
Expand Down
6 changes: 6 additions & 0 deletions src/lib/platform/MSWindowsScreen.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ class MSWindowsScreen : public PlatformScreen
bool onMouseButton(WPARAM, LPARAM);
bool onMouseMove(SInt32 x, SInt32 y);
bool onMouseWheel(SInt32 xDelta, SInt32 yDelta);
bool onPointerInput(WPARAM wParam, LPARAM lParam);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bool onPointerInput(WPARAM wParam, LPARAM lParam);

bool isPointerTypeTouch(UINT32 pointerId) const;
bool onScreensaver(bool activated);
bool onDisplayChange();
bool onClipboardChange();
Expand Down Expand Up @@ -343,6 +345,10 @@ class MSWindowsScreen : public PlatformScreen

MSWindowsHook m_hook;

// Touch input local policy - when true, touch stays on primary screen
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Touch input local policy - when true, touch stays on primary screen

bool m_touchInputLocal;
bool m_lastInputWasTouch;

static MSWindowsScreen *s_screen;

IEventQueue *m_events;
Expand Down
Loading
Loading