Deskflow
1.26.0.418
Keyboard and mouse sharing utility
Toggle main menu visibility
Loading...
Searching...
No Matches
ISecondaryScreen.h
Go to the documentation of this file.
1
/*
2
* Deskflow -- mouse and keyboard sharing utility
3
* SPDX-FileCopyrightText: (C) 2025 - 2026 Deskflow Developers
4
* SPDX-FileCopyrightText: (C) 2012 - 2016 Synergy App Ltd
5
* SPDX-FileCopyrightText: (C) 2003 Chris Schoeneman
6
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
7
*/
8
9
#pragma once
10
11
#include "
common/Coordinate.h
"
12
#include "
common/Settings.h
"
13
#include "
deskflow/MouseTypes.h
"
14
16
20
class
ISecondaryScreen
21
{
22
public
:
23
ISecondaryScreen
()
24
{
25
m_invertYScroll =
Settings::value
(
Settings::Client::InvertYScroll
).toBool();
26
m_yScrollScale = std::clamp(
Settings::value
(
Settings::Client::YScrollScale
).toDouble(), 0.1, 10.0);
27
m_invertXScroll =
Settings::value
(
Settings::Client::InvertXScroll
).toBool();
28
m_xScrollScale = std::clamp(
Settings::value
(
Settings::Client::XScrollScale
).toDouble(), 0.1, 10.0);
29
}
30
31
virtual
~ISecondaryScreen
() =
default
;
33
34
36
39
virtual
void
fakeMouseButton
(
ButtonID
id
,
bool
press) = 0;
40
42
45
virtual
void
fakeMouseMove
(int32_t x, int32_t y) = 0;
46
48
51
virtual
void
fakeMouseRelativeMove
(int32_t dx, int32_t dy)
const
= 0;
52
58
virtual
void
fakeMouseWheel
(
ScrollDelta
delta)
const
= 0;
59
66
ScrollDelta
applyScrollModifier
(
ScrollDelta
delta)
const
67
{
68
delta.
y
=
static_cast<
int32_t
>
(m_invertYScroll ? delta.
y
* -m_yScrollScale : delta.
y
* m_yScrollScale);
69
delta.
x
=
static_cast<
int32_t
>
(m_invertXScroll ? delta.
x
* -m_xScrollScale : delta.
x
* m_xScrollScale);
70
return
delta;
71
}
72
73
private
:
78
bool
m_invertYScroll =
false
;
79
84
double
m_yScrollScale = 1.0;
85
90
bool
m_invertXScroll =
false
;
91
96
double
m_xScrollScale = 1.0;
98
};
Coordinate.h
ScrollDelta
Coordinate ScrollDelta
Definition
Coordinate.h:21
MouseTypes.h
ButtonID
uint8_t ButtonID
Mouse button ID.
Definition
MouseTypes.h:16
Settings.h
ISecondaryScreen::fakeMouseWheel
virtual void fakeMouseWheel(ScrollDelta delta) const =0
Synthesize a mouse wheel event of amount This Implmentation for this method should call applyScrollMo...
ISecondaryScreen::~ISecondaryScreen
virtual ~ISecondaryScreen()=default
ISecondaryScreen::fakeMouseRelativeMove
virtual void fakeMouseRelativeMove(int32_t dx, int32_t dy) const =0
Fake mouse move.
ISecondaryScreen::fakeMouseButton
virtual void fakeMouseButton(ButtonID id, bool press)=0
Fake mouse press/release.
ISecondaryScreen::fakeMouseMove
virtual void fakeMouseMove(int32_t x, int32_t y)=0
Fake mouse move.
ISecondaryScreen::applyScrollModifier
ScrollDelta applyScrollModifier(ScrollDelta delta) const
Applies any scroll modfifers to the provided delta, This should only be done inside the subclasses fa...
Definition
ISecondaryScreen.h:66
ISecondaryScreen::ISecondaryScreen
ISecondaryScreen()
Definition
ISecondaryScreen.h:23
Settings::value
static QVariant value(const QString &key=QString())
Definition
Settings.cpp:361
Coordinate::x
int32_t x
Definition
Coordinate.h:17
Coordinate::y
int32_t y
Definition
Coordinate.h:18
Settings::Client::InvertXScroll
static const auto InvertXScroll
Definition
Settings.h:41
Settings::Client::XScrollScale
static const auto XScrollScale
Definition
Settings.h:43
Settings::Client::YScrollScale
static const auto YScrollScale
Definition
Settings.h:42
Settings::Client::InvertYScroll
static const auto InvertYScroll
Definition
Settings.h:40
src
lib
deskflow
ISecondaryScreen.h
Generated by
1.18.0