OpenClipboard() can fail transiently when another process holds the
clipboard mutex. Add a retry loop (5 attempts, 5ms delay) so that
Deskflow handles brief contention gracefully instead of immediately
failing.
this dialog has been the cause of alot of confusion,
it will almost always show up incorrectly at least once when connecting a new client
if you accept the client side dialog before adding the screen to the server
fixes: #9497
our last release was botched due to our repo being out of sync within a ~12hours of release a winget bot had already
completed the update and caused our future attempts with out now synced repo to fail. Lets lets winget bot do the winget release
For libei, there's no indication that a key is repeated.
However, sending repeated key down events (DKDN instead
of DKRP for the synergy protocol) can be confusing to
clients, which then causes issues like in #7971.
Detect repeated key down events in EiScreen server and
send them to the client with the repeat flag set, so in
e.g. synergy that causes the DKRP messages, to be less
confusing.
For me this fixes an issue where the synergy client is
creating a USB device, which requires repeated events
to be entirely dropped since the host OS where the USB
device is connected will do its own repeat when a key
is held down.
Replace TODO comments with proper exception handling in ArchMiscWindows::setValue methods.
When a nullptr registry key is passed, the functions now throw std::invalid_argument
instead of silently returning, improving error handling and making bugs easier to detect.
Removed assert statements as they are redundant with the exception handling.
This addresses the TODO comments in lines 163 and 173.
- Convert LockCursorToScreenInfo, SwitchToScreenInfo, SwitchInDirectionInfo,
and KeyboardBroadcastInfo from C-style malloc/free structs to proper C++
classes inheriting from EventData
- Replace char arrays with std::string for safer string handling
- Remove obsolete alloc() static methods in favor of constructors
- Update all call sites to use 'new' with constructors and getDataObject()
instead of malloc with alloc() and getData()
- Add 'do nothing' comments to empty constructors for SonarQube scans
- Maintain EventFlags::DeliverImmediately for proper event delivery
- Reduces code by 48 lines and eliminates manual memory management
- Improves type safety and follows modern C++20 practices
This change makes the code more maintainable and less prone to memory leaks
by leveraging C++ destructors for automatic cleanup.
allows us to simplify alot of the code around the lists and lets us also fliter lists easily
update copyright for 2026, add missing deskflow devlopers for mainwindow for 2025 work
port: https://github.com/input-leap/input-leap/pull/1592
Original Message:
base: Remove IEventQueueBuffor newTimer and deleteTimer APIs
In the current implementation timers are not platform-specific. On all
currently supported platforms timer constrution and destruction is
simple new and delete, so it does not make sense having this
customization point.
Original Author: p12tic
Ported By: sithlord48
Disable macOS Automatic Termination to prevent the server/client from
being killed during memory pressure events. Adds NSSupportsAutomaticTermination
to Info.plist and programmatically disables termination in the Cocoa app.
Fixes#7329🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Qt `errorString()` only contains the error code and error text, but not the response body. And, in HTTP/2 the error string is gone but the error is still printed like it's there: https://bugreports.qt.io/browse/QTBUG-140126
- introduce NetworkMonitor class to track network addresses change
- replace QLineEdit with QComboBox for interface selection in settings
- implement automatic IP detection and suggestion logic
- add signal-slot connections for real-time network updates
Log: add network monitoring and IP address management.
loosely based on https:://github.com/deskflow/deskflow/pull/9303
where it was pointed out that using the gitrev as a fallback could create an invalid version
We wanted the value contained in the string as size_t, not the size (length) of
the string. size_t is (normally) an alias for unsigned long, so toUlong() should
do the trick.
fixes: #9274
The log file path is not able to be empty since Settings::value will return the default path if it is, Do not send a c_str to create our FileLogger it wants a QString
The correct command is `brew tap deskflow/tap` not `deskflow/homebrew-tap`.
Homebrew automatically strips the `homebrew-` prefix from repository names.
Related: https://github.com/deskflow/homebrew-tap/pull/6
move ClientConnectionTests to Qt Tests
track if the dialog is open in the gui
track suppression in clientConnection based on connect / disconnect message
this is currently based on wl-copy/wl-paste.
One could probably just implement wl-copy/wl-paste without adding much
complexity and better performance.
Co-authored-by: KoljaFrahm <GitHub.Kolja@dfgh.net>
Fixes: #9156
Names: contain only A-Z a-z 0-9 or - or . or _
replace any spaces with _
are < 256 characters in length
can not start or end with - _ or .
Set a screen name if the settings does not have one do this instead of returning a default value
Previously empty event targets were never fully removed from EventQueue
even after unregistration. This may lead to unbounded increase of memory
use if new event targets are allocated to new memory locations.
ported: c960360106
The Input Leap project (an attempt to continue Barrier development, a dead fork) has been inactive for a long while now.
This PR updates the readme to reflect this.
The Gui must always be built. The core can not function completely standalone
it is unable to add new clients or setup screens for example until such a time the gui is not optional.
Instead of asserting that the number of resolved ipv4 addresses is nonzero,
throw an exception. This will prevent the core from aborting if the host has
no ipv4 addresses.
The host can get into this state if the remote device loses its ipv4
advertisement midway through resolving, such as if an mdns host unpublishes
its ipv4 address as a result of going into a low-power state.
Signed-off-by: Sean Cross <sean@xobs.io>
Windows registry is horrible to deal with and makes it impractical to pass settings to the Core when run via daemon on Windows.
- Pass settings path to Core when launched via daemon
- Introduce portable mode detection logic on Windows
- Generalize `m_settingsFile` use
- Reduce #ifdef size for Settings ctor path logic
refactor: Rename job from 'sonarcloud-analysis' to 'analyze' in SonarCloud workflow
refactor: Reorder SonarQube scan and build wrapper installation steps in SonarCloud workflow
refactor: Update SonarQube scan step to use new action and streamline options
fix: Update SonarQube scan step to correctly pass coverage report paths and environment variables
fix: Set CPU core count to a fixed value in SonarCloud analysis workflow
refactor: Move 'Install Build Wrapper' step to the correct position in the SonarCloud analysis workflow
refactor: Remove unused Sonar Scanner environment variables from analysis workflow
panned screens still needs `xtestIsXineramaUnaware` option enabled. this change
forcefully uses XTest only when leaving
useful examples:
* double 1 FullHD screen (main output) by:
`xrandr --fb 3840x1080 --output DP-1 --panning 3840x1080+0+0/3840x1000+0+80`,
leaving top 80 pixels for moving mouse out without actual panning
* dedicate right half of framebuffer to FullHD TV (second output):
`xrandr --fb 3840x1080 --output HDMI-0 --panning 1920x1080+1920+0`
feat: get windows building with the UNICODE forced by using Qt
refactor: remove ARCHString use QString to convert to / from utf8
build: (arch) link to common
build: (base) link to arch
build: (io) Link to common
build: (client) link to common
build: (server) link to common
fix: Append to log file instead of creating a new one each log line
refactor: Trim cipher description for neater log output
fix: Update log messages to use wide string format for Unicode support
fix: Correct event creation to use wide string for Unicode compatibility
refactor: Use QStringDecoder for UTF-8 handling on Windows Daemon child process
fix: Use correct wide type for Win32 consts
There's no need to hold the mutex while constructing a `std::string`
from the `char` string.
Also use `inet_ntop` instead of the potentially thread-unsafe
`inet_ntoa` that might use a static buffer for the result.
This makes the `INet` case match the `INet6` case below.
The `static` keyword was removed by #8674 but I think it should be
restored so that this global can't clash with anything else called
`::s_mutex` elsewhere in the executable.
Making a proxy class for QProcess to make GTest work is an excellent example of over-abstraction making simple things hard to do. I just wanted to call a function on QProcess and had to jump through hoops to do it.
Bye bye QProcessProxy! We can do much better with QTest.
In the X11 code, we mapped hyper to super, so perhaps it makes sense to do that here too:
`src/lib/platform/XWindowsUtil.cpp`
```
case XK_Super_L:
case XK_Super_R:
case XK_Hyper_L:
case XK_Hyper_R:
return kKeyModifierBitSuper;
```
- Add a new method updateNetworkInfo to update lblIpAddresses
This method can be hooked to the system network info in the future
when we want to have this be more dynamic.
- Only show the IP address when in server mode.
- When showing the IP address show either the suggested IP or a message the user maybe offline
- Use the linkVisited color to for our error message
Some modifiers, notably LevelThree, were not accounted for in the
modifier mask calculation. This leads to an incorrect keymap where some
key symbols were listed for keys without (or insufficient) modifiers.
Emulating those keys can then produce the wrong keysyms.
Reproducible with server and client on English(UK) layout and typing
e.g. [. That key has its own key AD11 (right of P) but is also on
the third level of AE08 (the 8 key). When the server sends the keyid 91
(for [) the client looks it up in the pre-generated keymap. It is found
first on the 8 key with no modifiers (because LevelThree was previously
ignored), hence the client simulates a key 8 press without modifiers.
This erroneously produced an 8 instead of the wanted [.
Fix this by ensuring that all modifiers are accounted for in the key
map. This fix is likely incomplete as it does not account for the full
virtual modifier to real modifier mappings possible (e.g. Mod5 *may* be
something other than AltGr) but it does push the can a bit further down
the road, for someone else to release the worms.
Closes: #8168
For the longest time, this log line has bugged me:
```
active sides: e
```
It's hex, but it looks like a bug, since there's no `0x` prefix. Also, most humans can't read hex, so I added a string representation.
New version:
```
[2025-08-06T11:56:00] DEBUG: active sides: LRT (0x0e)
```
It is likely random whether the server works or not without
a manually configured protocol option, which is neither documented
nor enforced to be set.
With a random uninitialized value in m_protocol, this can happen:
[2025-08-03T12:39:57] NOTE: accepted client connection
[2025-08-03T12:39:57] FATAL: a runtime error occurred: XInvalidProtocol
Reports of "it works with debug enabled" are likely due to having
parts of the memory space the server object is allocated into being
cleared, and thus having a 0 (Synergy) startup value.
Previously we were toggling the 'MouseKeys' Windows accessibility feature on and off, but this was causing many bugs; cursor show delay while Windows brings up the mouse stack(?) and often forever lost mouse cursor when toggling off the 'MouseKeys' feature. After a few days of hacking away at this, it seems safest to just leave it on.
The `ShowCursor` function does not directly show/hide the cursor; it increments or decrements the internal display counter. When that counter reaches a certain positive/negative number, then the cursor is shown or hidden at a particular threshold.
By default, help2man generates "manual page for foobar" for
manual files.
It is useless because there is no addtional information which
explains what deskflow is.
With --name option, .SH NAME section will be set correctly.
Before:
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH DESKFLOW-CLIENT "1" "June 2025" "deskflow-client v1.22.0.109, protocol v1.8" "User Commands"
.SH NAME
deskflow-client \- manual page for deskflow-client v1.22.0.109, protocol v1.8
.SH SYNOPSIS
.B deskflow-client
[\fI\,OPTIONS\/\fR]
.SH DESCRIPTION
After:
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH DESKFLOW-CLIENT "1" "July 2025" "deskflow-client v1.22.0.109, protocol v1.8" "User Commands"
.SH NAME
deskflow-client \- Keyboard and mouse sharing utility (Client)
.SH SYNOPSIS
.B deskflow-client
[\fI\,OPTIONS\/\fR]
.SH DESCRIPTION
Signed-off-by: Kentaro Hayashi <kenhys@xdump.org>
slight reword for Already Connected error
use QString::append to add to the message
create a QMessageBox::warning style box for these errors
enable translations
XArch no longer contains any extra functionality in addition to what
std::runtime_error nor it signifies a particular type of error.
based-on: 5b991692af
ported-by: sithlord48
This functionality is not needed because in all code paths the error
code is immediately converted to string without actually using the lazy
evaluation functionality.
based-on: 53dff5b803
ported and expanded by sithlord48
If we're starved for resources, we may end up with more than 64
notifications in our pipe before we get to actually read them.
Those notifications are just that though, so let's drain them.
Both trigger:
warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
In the first hunk we already checked for i < 0 so casting to size_t is
fine. In the second hunk we don't use i so we can pick the right type.
they are not correct in the help and its dynamic based on the first found Deskflow.conf file. The gui sets this manually and users running the cli should too
Adds a CONTRIBUTING.md file to the project root. I totally understand the preference to keep the root directory clean and normally I'd agree. However, GitHub requires CONTRIBUTING.md to be in the root in order to automatically show a “Contribute” prompt when someone opens a new issue or PR.
It also means we can be recognized by platforms like goodfirstissue.dev (https://github.com/DeepSourceCorp/good-first-issue?tab=readme-ov-file#adding-a-new-project:~:text=project%2C%20and%20a-,CONTRIBUTING.md,-with%20guidelines%20for), which requires the file to be in the root to detect a repo as contributor-friendly
The file itself is very lightweight, just a short intro and a link to our full guide on the wiki:
https://github.com/deskflow/deskflow/wiki/Contributing
This keeps the root file tidy while still meeting the visibility requirements for tools and new contributors.
Let me know if you'd prefer any tweaks to keep it as non-intrusive as possible.
It seems that `layoutLangCode.empty()` is true on my GNOME Wayland server every time I press a key. I don't know why, but it probably means something. Client doesn't seem to matter; happens for all client OS.
Only use `Qt::endl` when writing to the output stream; `Q_EMIT newLine` should not include a trailing newline because `appendPlainText` doesn't expect one.
We want the Deskflow community to be one where everyone can work together. We pledge to keep our community focused on the project and the code around the project.
## Community Standards
* Keep interactions respectful and focused on the project
* Contributions are expected to follow the [contribution guide](https://github.com/deskflow/deskflow/wiki/Contributing).
## Enforcement
Enforcement will be done at the descression of the Deskflow Moderators.
Thanks for your interest in contributing to Deskflow! We welcome all kinds of contributions — bug reports, feature suggestions, documentation improvements, and code.
## Read the Full Guidelines
To keep this repository clean and contribution-friendly, we've outlined our full contributing guidelines on the Deskflow Wiki:
👉 [How to Contribute to Deskflow](https://github.com/deskflow/deskflow/wiki/Contributing)
Please take a moment to read through the page before opening an issue or submitting a pull request.
value:Thanks for taking the time to help us improve Deskflow.
value:|
Thanks for taking the time to help us improve Deskflow.
- type:dropdown
id:project
- type:checkboxes
id:sanity-checks
attributes:
label:Project
description:Are you using Deskflow or a fork/derivative?
label:Sanity checks
description:|
Before reporting a bug, please first:
1. Try the latest [continuous build](https://github.com/deskflow/deskflow/releases).
2. Wayland users, please review the [known issues](https://github.com/deskflow/deskflow/discussions/7499).
3. macOS users, if the app crashes, try [Apple's solution](https://support.apple.com/guide/mac-help/open-a-mac-app-from-an-unknown-developer-mh40616/mac).
options:
# Empty option to force selection
-
- Deskflow
- Barrier
- Input Leap
- Synergy
default:0
- label:I have done the sanity checks, and my issue persists
-label:These sanity checks are not relevant to the bug
validations:
required:true
- type:textarea
id:version
attributes:
@ -66,60 +66,21 @@ body:
validations:
required:true
- type:checkboxes
id:linux-wayland
attributes:
label:Wayland on Linux
description:If using Wayland on Linux, please review the [known issues](https://github.com/deskflow/deskflow/discussions/7499) before reporting.
options:
- label:I have reviewed the Wayland [known issues](https://github.com/deskflow/deskflow/discussions/7499) and my issue is new
- label:I am not using Wayland on Linux
- type:checkboxes
id:mac-signing
attributes:
label:Signing on macOS
description:If using macOS and the app crashes, try [Apple's solution](https://support.apple.com/guide/mac-help/open-a-mac-app-from-an-unknown-developer-mh40616/mac) before reporting.
options:
- label:I have authorized the app to run on my Mac
- label:I am not using macOS
- type:checkboxes
id:continuous-build
attributes:
label:Continuous build
description:Please try the latest [continuous build](https://github.com/deskflow/deskflow/releases) of Deskflow. It may have a fix for your issue.
options:
- label:I have tried the latest continuous build and the issue persists
- label:I am unable to try the latest continuous build
- type:textarea
id:os-version
attributes:
label:OS versions/distros
description:|
Please provide the version number of your operating system (OS).
If you're using Linux, please provide the name of the distribution.
placeholder:|
- Windows 11
- macOS 15
- Ubuntu 24.04
- FreeBSD 14.0
validations:
required:true
- type:textarea
id:config
attributes:
label:Deskflow configuration
description:|
Please provide a very brief description of your configuration.
Let us know what OS your server and client are running.
Let us know what OS your server and client are running, including all OS versions.
If you're using Linux, please provide the name of the distribution.
> [Synergy](https://symless.com/synergy) sponsors the Deskflow project by contributing code and providing financial support.
>
> - [**Bounties**](https://github.com/deskflow/deskflow/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22%F0%9F%92%8E%20bounty%22) - Earn while contributing to open source
> - [**Rewarded**](https://github.com/deskflow/deskflow/issues?q=label%3A%22%F0%9F%92%B0%20rewarded%22%20) - Issues with a rewarded bounty
>
> **Deskflow** is the official upstream project for Synergy.
> Purchasing a Synergy license is one way to support Deskflow’s growth and sustainability.
> Learn more: [Relationship with Synergy](https://github.com/deskflow/deskflow/wiki/Relationship-with-Synergy)
**Deskflow** is a free and open source keyboard and mouse sharing app.
Use the keyboard, mouse, or trackpad of one computer to control nearby computers,
@ -16,12 +10,30 @@ and work seamlessly between them.
It's like a software KVM (but without the video).
TLS encryption is enabled by default. Wayland is supported. Clipboard sharing is supported.
> [!TIP]
>
> **Chat with us**
>
> - Main discussion on Matrix: [`#deskflow:matrix.org`](https://matrix.to/#/#deskflow:matrix.org) ([Matrix clients](https://matrix.org/ecosystem/clients/))
> - Discussion also happens on IRC: `#deskflow` or `#deskflow-dev` on [Libera Chat](https://libera.chat/)
> - Start a [new discussion](https://github.com/deskflow/deskflow/discussions) on our GitHub project.
## Download
[](https://github.com/deskflow/deskflow/releases/latest) [](https://github.com/deskflow/deskflow/releases/continuous) [](https://flathub.org/apps/org.deskflow.deskflow)
To use Deskflow you can use one of our [packages](https://github.com/deskflow/deskflow/releases), install `deskflow` (if available in your package repository), or [build it](#build-quick-start) yourself from source.
> [!NOTE]
> On Windows, you will need to install the
> [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-microsoft-visual-c-redistributable-version).
> For macOS users, the easiest way to install and stay up to date is to use [Homebrew](https://brew.sh) with our [homebrew-tap](https://github.com/deskflow/homebrew-tap).
> macOS reports unsigned apps as damaged. This occurs because we do not use an Apple certificate for notarization. Clear the quarantine attribute to run the app: `xattr -c Deskflow.app`
To use Deskflow, download one of our [packages](https://github.com/deskflow/deskflow/releases), install `deskflow` (from your package repository), or [build it](https://github.com/deskflow/deskflow/wiki/Building) from source.
[](https://github.com/deskflow/deskflow/commits/master/)
@ -36,27 +48,16 @@ To use Deskflow you can use one of our [packages](https://github.com/deskflow/de
- Motivated by the community interests (not business-driven)
- Privacy by default (e.g. update check is off by default)
- Leading edge releases (we don't focus on supporting older systems)
- Decisions are discussed and documented publicly with majority rule
- Have fun; we don't need to worry about impressing anyone
## Contribute
## Ways to get involved
[](https://github.com/deskflow/deskflow/labels/good%20first%20issue)
> [!TIP]
> Join us! Real-time discussion on Matrix: [`#deskflow:matrix.org`](https://matrix.to/#/#deskflow:matrix.org)
>
> Alternatively, we have [other ways](https://github.com/deskflow/deskflow/wiki/Chat-with-us) to communicate.
>
Here are a few ways to join in with the project and get involved:
* Build the latest `master` version (see below) and [report a bug](https://github.com/deskflow/deskflow/issues)
* [Submit a PR](https://github.com/deskflow/deskflow/wiki/Contributing) (pull request) with a bug fix or improvement
* [Let us know](https://github.com/deskflow/deskflow/issues) if you have an idea for an improvement
There are many ways to contribute to the Deskflow project.
## Build Quick Start
We're a friendly, active, and welcoming community focused on building a great app.
Read our [Contributing](https://github.com/deskflow/deskflow/wiki/Contributing) page to get started.
For instructions on building Deskflow, use the wiki page: [Building](https://github.com/deskflow/deskflow/wiki/Building)
@ -64,14 +65,9 @@ For instructions on building Deskflow, use the wiki page: [Building](https://git
We support all major operating systems, including Windows, macOS, Linux, and Unix-like BSD-derived.
> [!NOTE]
> On Windows, you will need to install the
> [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-microsoft-visual-c-redistributable-version).
Downstream commercial fork and Deskflow sponsor, geared toward adapting to customer
needs, offering business and enterprise licensing.
- [**Synergy**](https://symless.com/synergy) -
Downstream commercial fork. Synergy sponsors Deskflow with financial support and contributes code ([learn more](https://github.com/deskflow/deskflow/wiki/Relationship-with-Synergy)).
[](https://symless.com/synergy)
[Synergy](https://symless.com/synergy) sponsors the Deskflow project by contributing code and providing financial support ([learn more](https://github.com/deskflow/deskflow/wiki/Relationship-with-Synergy)).
Deskflow is made by possible by these contributors.
<p>This stable release fixes known issues and adds a few new features. Most notable symbolic icon support, I18N support and experimental support for wl-clipboard to access clipboards on wayland. This release also continues our trend of cleaning up the codebase. For the full changelog, see the release page.</p>
<ul>
<li>Removed the ability to use toml config and env based config files</li>
<li>Set XDG app ID (app_id) on Wayland</li>
<li>Support symbolic icon deployment and recoloring</li>
<li>Added Spanish translation</li>
<li>Added Italian translation</li>
<li>Added Japanese translation</li>
<li>Added Simplified Chinese translation</li>
<li>Added Russian translation</li>
<li>Translate the GUI without needed to restart the application</li>
<li>Expose setting to adjust clients scroll speed</li>
<li>Expose setting to show the GUI debug messages in the log</li>
<li>Expose setting to allow use of wl-clipboard backend on Wayland</li>
<li>Fixed the port settings not being used from settings</li>
<li>Save the geometry info into a state file</li>
<li>The Core (deskflow-core) has a new CLI interface</li>
<p>This stable release fixes issues found in the previous version and adds a few new features. This release also uses more C++20 features. For the full changelog, see the release page.</p>
<ul>
<li>Fix: Less confusing fingerprint comparision dialog.</li>
<li>Fix: AltGr and other modifiers are generally detected better.</li>
<li>Fix: Big Endian test failures</li>
<li>Fix: Client scroll direction being ignored on wayland clients.</li>
<li>Feat: Unify deskflow-client and deskflow-server into one binary deskflow-core.</li>
<li>Feat: Prevent more than one instance of deskflow-core starting.</li>
<p>This stable release fixes issues found in the previous version and adds a few new features. This release also uses more C++20 features. For the full changelog, see the release page.</p>
<ul>
<li>Fix: Core app not running when app starts minimized.</li>
<li>Fix: Several items in the server configuration dialog being enabled at the wrong time.</li>
<li>Fix: Use the correct license in our appstream data (GPL2.0 only).</li>
<li>Fix: Apps saved size could grow over time on desktops using client side decorations.</li>
<li>Fix: Use the system monospace font in the log area, instead of forcing one that may not be on the system.</li>
<li>Fix: Issue with incorrect borders being set for libEI, causing issues on edges without neighbors.</li>
<li>Feat: Add Restart action for the core process.</li>
Deskflow is a free and open source keyboard and mouse sharing app. Use the keyboard, mouse, or trackpad of one computer to control nearby computers, and work seamlessly between them.
- View the [wiki](https://github.com/deskflow/deskflow/wiki) Online resource
### Chat with us
- Main discussion on Matrix: [`#deskflow:matrix.org`](https://matrix.to/#/#deskflow:matrix.org) ([Matrix clients](https://matrix.org/ecosystem/clients/))
- Discussion also happens on IRC: `#deskflow` or `#deskflow-dev` on [Libera Chat](https://libera.chat/)
- Start a [new discussion](https://github.com/deskflow/deskflow/discussions) on our GitHub project.
## Reporting security issues
Check [Security](Security.md) to find out how to report security issues.
It is recommended to use vcpkg to install the dependencies. The first time you configure Deskflow, all dependencies other than Qt will be built. If you don't want to use vcpkg, you must manually setup the dependencies. However, that will not be covered by this document.
#### Windows and Qt
There are two ways you can install [Qt] on Windows (vcpkg or Qt online installer). The default configuration expects you to use the Qt online installer. You should not install Qt in both ways, as having both can cause some weird things to happen, like Qt getting libs from one install and plugins from the other. When switching between them, remove the previous install first.
##### System Qt
1. Download and install the [Qt] online installer from their website.
2. Add the path of Qt's cmake files to your system path (skipping this may require you provide this path to cmake via `Qt6_DIR` at configure time).
- Often: `C:\Qt\<version>\<msvcinfo>\lib\cmake`
3. Add the path of Qt's binary tools to your system path.
- Often: `C:\Qt\<version>\<msvcinfo>\bin`
##### vcpkg managed Qt
1. Add the option `-DVCPKG_QT=ON` to your cmake configuration command (i.e `cmake -S. -Bbuild -DVCPKG_QT=ON ...`) or if using an IDE, look for the option where you configure the project, have the IDE run cmake again.
2. Once the configuration starts, you should see a lot more packages vcpkg will build. Building Qt takes a long time (potentially hours), so go find something else to do for a while.
3. If you want to use the system Qt again, you must delete the `vcpkg.json` generated in the project root and the `build` folder and reconfigure the project from scratch.
### macOS codesign
The code signing option `APPLE_CODESIGN_DEV` is only for local development and not intended for distributed bundles.
Signing for local development and signing for the distribution bundle must be different because of development entitlements which are unlikely to be safe for use in production. It is impractical (i.e. very slow and cumbersome) to use the distribution bundle for local development. When developing locally, the app bundle is partial and does not contain dependencies and uses external libs, e.g. installed with Homebrew; the entitlements allow those external libs to be loaded which is not allowed by default.
For development codesign:
1. Install Xcode
2. Go to Settings -> Accounts
3. Add your account (requires a free Apple Developer ID)
4. Manage certificates -> Add -> Apple Development
5. To get your ID, run: `security find-identity -v -p codesigning login.keychain-db`
6. Pass the ID to CMake, e.g. `-DAPPLE_CODESIGN_DEV=Apple Development: bob@exmaple.com (KLGSJHLFXY)`
7. Configure and build
8. To verify, run: `codesign -d -r- build/bin/Deskflow.app`
## Build
After configuring you should be able to run make to build all targets.
`cmake --build build`
## Install
To test installation run `DESTDIR=<installDIR> cmake --install build` to install into `<installDir>/<CMAKE_INSTALL_PREFIX>`
Running `cmake --install build` will install to the `CMAKE_INSTALL_PREFIX`
## Making Deskflow packages
Deskflow can generate several packages using `cpack`.
To generate packages build the `package` or `package_source` target.
Example: ` cmake --build build --target package package_source` would generate both package and package source packages.
Deskflow can generate several package types depending on the system.
Archive-based packages should work on all platforms. On Linux deb and rpm info is set up, Flatpaks can be generated from the included file in deploy/linux and a `PKGBUILD` for Arch linux is generated in the build folder. On macos a dmg file will be created and signed. For windows WiX can be used to create an installer.
Thanks for your interest in contributing to Deskflow! We welcome all kinds of contributions — bug reports, feature suggestions, documentation improvements, and code.
## Read the Full Guidelines
To keep this repository clean and contribution-friendly, we've outlined our full contributing guidelines on the Deskflow Wiki:
👉 [How to Contribute to Deskflow](https://github.com/deskflow/deskflow/wiki/Contributing)
Please take a moment to read through the page before opening an issue or submitting a pull request.
**Deskflow** is a free and open source keyboard and mouse sharing app.
Use the keyboard, mouse, or trackpad of one computer to control nearby computers,
and work seamlessly between them.
Deskflow acts as a software KVM (without video) that allows you to:
- Share keyboard and mouse input across multiple computers
- Synchronize clipboard content between machines
- Work seamlessly across different operating systems (Windows, macOS, Linux, BSD)
Deskflow software consists of a **server** (primary computer) that shares its input devices and **clients** (secondary computers) that receive and execute the input commands over a TCP network connection.
### Architecture Overview
Deskflow is built with a modular, cross-platform architecture:
│ Server App │◄──────────────────────►│ Client App │
│ │ (Port 24800) │ (Windows) │
│ ┌─────────────┐ │ │ ┌─────────────┐ │
│ │ Screen │ │ │ │ Screen │ │
│ │ Platform │ │ │ │ Platform │ │
│ │ Layer │ │ │ │ Layer │ │
│ └─────────────┘ │ │ └─────────────┘ │
└─────────────────┘ └─────────────────┘
┌───────┐ ┌───────┐
│ Keyb. │ │ Mouse │
└───────┘ └───────┘
┌─────────────────┐
│ Client App │
│ (macOS) │
│ ┌─────────────┐ │
│ │ Screen │ │
│ │ Platform │ │
│ │ Layer │ │
│ └─────────────┘ │
└─────────────────┘
┌─────────────────┐
│ Client App │
│ (Custom) │
│ ┌─────────────┐ │
│ │ Screen │ │
│ │ Platform │ │
│ │ Layer │ │
│ └─────────────┘ │
└─────────────────┘
```
### More info
For more info, see our [Wiki](https://github.com/deskflow/deskflow/wiki).
Check out our [Building guide](build.md) or our general @ref contributing_guide "Contributing section". We also have a detailed [Protocol Reference](protocol_reference.md).
This document provides a comprehensive reference for the Deskflow network protocol. It is the primary source of information for developers implementing Deskflow clients or extending the protocol.
## Protocol Overview
The Deskflow protocol enables keyboard and mouse sharing between multiple computers over a TCP network connection. The protocol uses two distinct sets of terminology to describe the roles of the computers involved:
- **Network Role (Client/Server)**: This describes the connection architecture.
- **Server**: The machine that listens for incoming TCP connections.
- **Client**: The machine that initiates the TCP connection to the server.
- **Input Control Role (Primary/Secondary)**: This describes the flow of keyboard and mouse events.
- **Primary**: The computer whose keyboard and mouse are currently being used to control other computers.
- **Secondary**: A computer that is being controlled by the Primary's keyboard and mouse.
In a typical setup, the Primary computer (the one whose keyboard and mouse are shared) also acts as the Server. However, the protocol is flexible and allows these roles to be separate. For example, a Primary machine can act as a Client to connect to a Secondary machine that is configured as a Server. This can be useful for navigating restrictive network environments like firewalls.
Throughout the documentation, message direction is often described using the Primary/Secondary roles to clarify the input control flow, while Client/Server roles are used when discussing the underlying network connection.
The protocol operates over a standard TCP connection on port 24800. In protocol versions 1.4 and later, TLS encryption is supported for secure communications.
## Protocol State Machine
The client's connection lifecycle is defined by five primary states:
```
┌──────────────────┐
│ START │
└────────┬─────────┘
│
▼
┌────────┴─────────┐
│ DISCONNECTED │
│ (Initial & │◄───────────────────┐
│ Final State) │ │
└────────┬─────────┘ │
│ │
▼ │
┌──────────────────┐ │
│ CONNECTING │ TCP Failure │
│ (TCP handshake) ├───────────────────►┤
└────────┬─────────┘ │
│ │
TCP Success │ │
│ │
▼ │
┌──────────────────┐ │
│ HANDSHAKE │ Version Mismatch │
│ (Hello/HelloBk) ├───────────────────►┤
└────────┬─────────┘ │
│ │
OK │ │
│ │
▼ │
┌──────────────────┐ │
│ CONNECTED │ CCLOSE (close) │
┌───►│ (Authenticated ├───────────────────►┤
│ │ but inactive) │ │
│ └────────┬─────────┘ │
│ │ │
COUT │ CINN │ │
(Leave) │ (Enter)│ │
│ ▼ │
│ ┌──────────────────┐ │
└────┤ ACTIVE │ CCLOSE (close) │
│ (Receiving all ├───────────────────►┘
┌───►│ input events) │
│ └────────┬─────────┘
│ │
│ ▼
│ ┌──────────────────┐
└────┤ PROCESS EVENT │
└──────────────────┘
```
### State Descriptions
1.**Disconnected**: Initial and final state. No connection to @ref Server.
2.**Connecting**: @ref TCPSocket connection attempt in progress.
- Initiating @ref TCPSocket connection.
- On successful TCP connection, moves to the `Handshake` state.
- If TCP connection fails (timeout, RST packet), returns to `Disconnected`.
3.**Handshake**: Protocol version negotiation and authentication.
-@ref Server sends @ref kMsgHello with protocol version information.
-@ref Client responds with @ref kMsgHelloBack including version and screen name.
-@ref Server validates the client's message.
- Success transitions to `Connected`, failure sends @ref kMsgEIncompatible error.
4.**Connected**: Authenticated but not receiving input events.
-@ref Client must respond to @ref kMsgCKeepAlive messages from the @ref Server.
- Receiving @ref kMsgCEnter message transitions to `Active`.
5.**Active**: Receiving and processing input events from @ref Server.
- Receiving @ref kMsgCLeave message transitions back to `Connected`.
- Receiving @ref kMsgCClose message transitions to `Disconnected`.
## Message Categories
The protocol organizes messages into logical categories:
This table lists all protocol messages in alphabetical order. For a typical sequence of messages, see the [Typical Control Flow](#typical-control-flow) section.
| Message | Constant | Category | Direction | Purpose | Constraints | Protocol Version |
| [**DCLP**](@ref kMsgDClipboard) | @ref kMsgDClipboard | Data | Both | Clipboard data | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
| [**DDRG**](@ref kMsgDDragInfo) | @ref kMsgDDragInfo | Data | Server→Client | Drag file info | [MsgSize](#constraint-protocol-max-message-length), [ListSize](#constraint-max-list) | 1.5+ |
| [**DFTR**](@ref kMsgDFileTransfer) | @ref kMsgDFileTransfer | Data | Both | File transfer data | [MsgSize](#constraint-protocol-max-message-length) | 1.5+ |
| [**DINF**](@ref kMsgDInfo) | @ref kMsgDInfo | Data | Client→Server | Screen information | [MsgSize](#constraint-protocol-max-message-length) | 1.0+ |
| [**DKDL**](@ref kMsgDKeyDownLang) | @ref kMsgDKeyDownLang | Data | Server→Client | Key down with language | [MsgSize](#constraint-protocol-max-message-length), [KeyMap](#constraint-keymap) | 1.8+ |
| [**DKDN**](@ref kMsgDKeyDown) | @ref kMsgDKeyDown | Data | Server→Client | Key down | [MsgSize](#constraint-protocol-max-message-length), [KeyMap](#constraint-keymap) | 1.1+ |
| [**DKDN**](@ref kMsgDKeyDown1_0) | @ref kMsgDKeyDown1_0 | Data | Server→Client | Key down (legacy) | [MsgSize](#constraint-protocol-max-message-length), [KeyMap](#constraint-keymap) | 1.0 |
Maximum size of the initial Connection Handshake message
Defined in Protocol Limits
<aid="constraint-tls"></a>
### TLS Handshake and Security (Protocol v1.4+)
When encryption is enabled, the protocol follows this sequence:
1. Standard TCP connection established
2. TLS handshake performed over TCP socket
3. Protocol handshake begins only after TLS session is established
- **Implementation Details**:
- The client initiates a standard TCP connection, then the (private) SecureSocket::handleTCPConnected method is called, which begins the TLS handshake
- **Certificate Validation**:
- Client implementations **must** validate the server's certificate
- The reference implementation checks that the public key is RSA or DSA and that the key length is at least 2048 bits
### Key Code and Modifier Mapping
A modifier (modifier mask) represents the state of modifier keys (like Shift, Control, Alt, and Command) on a keyboard. It is a binary code (like 0000 0110) where each bit corresponds to a specific modifier key.
**Key-Up/Key-Down Strategy:**
-<aid="constraint-keymap"></a>Client must use the @ref KeyButton (physical key) to track pressed keys, as the @ref KeyID (virtual key) can change based on modifier state
- This strategy is described in the documentation for @ref kMsgDKeyDown
**Modifier Remapping:**
- The server can command clients to remap modifier keys via the @ref kMsgDSetOptions message
- The client processes the @ref kMsgDSetOptions message and updates the modifier translation table accordingly
## Timing and Synchronization
<aid="constraint-keep-alive"></a>
### Keep-Alive Mechanism (Protocol v1.3+)
**Server-Side Behavior:**
- The server sends kMsgCKeepAlive messages every 3.0 seconds (defined by @ref kKeepAliveRate)
- This timer is implemented in @ref ClientProxy1_3::addHeartbeatTimer in the @ref ClientProxy1_3 class
**Client-Side Behavior:**
- Upon receiving a kMsgCKeepAlive message, the client must immediately send a kMsgCKeepAlive message back
- The client maintains a timeout that is reset each time any message is received
- If no message is received for 9.0 seconds (3 ×@ref kKeepAliveRate), client must disconnect
- This is handled by the (private) ServerProxy::handleKeepAliveAlarm method
<aid="constraint-screen-entry-sync"></a>
### Synchronization on Screen Entry
- The @ref kMsgCEnter (Enter Screen) message includes the current modifier state
- Client must synchronize their local modifier state with this mask
<aid="constraint-handshake-timeout"></a>
### Handshake Timeout
- Server allows **30 seconds** for handshake completion
- If client fails to send valid @ref kMsgHelloBack within this time, connection is closed
- When a new client connects, the server creates a temporary @ref ClientProxyUnknown to handle the version handshake
- A one-shot timer is started for 30 seconds
- If the client fails to respond in time, the @ref protocol_errors function is triggered, the connection is logged as unresponsive, and the socket is closed
## Version Compatibility
| Version | Release Date | Project | Features | Compatibility |
| autoHide | `true` or `false` | When true the app will hide itself on start up [default: false] |
| enableUpdateCheck | `true` or `false` | When true check the update URL to see if a new version was released on start up [default: false] |
| closeReminder | `true` or `false` | Used to track if we have shown the reminder that when you close the app it remain running in the background [default: true]|
| closeToTray | `true` or `false` | When `true` the gui will run in the systemTray when its closed [default: true] |
| logExpanded | `true` or `false` | Should the log section of the GUI be opened [default: false] |
| symbolicTrayIcon | `true` or `false` | When true use the monocolor (symbolic) icon false uses a colorful icon for the tray [default: true] |
| windowGeometry | QRect | Geometry of the window used to restore the window geometry after exiting the app |
| showGenericClientFailureDialog | `true` or `false` | When `true` client connection errors will not show popup error messages [default: true] |
| shownFirstConnectedMessage | `true` or `false` | When `true` GUI has shown the user the message for connecting the first time [default: false] |
| shownServerFirstStartMessage | `true` or `false` | When `true` GUI has shown the user the Deskflow server is now running message [default: false] |
| shownVerionInTitle | `true` or `false` | When `true` GUI will include the version in the window title [default: false] |
| startCoreWithGui | `true` or `false` | When true the Core will be started with the GUI. It is set to the Core's state on exit. |
| updateCheckUrl | URL | The URL to use when checking for a new version number, it should return a version [default: https://api.deskflow.org/version]|
### Log
This section contains options used by the application logging it will begin with `[log]`
|Option | Valid Values |Description|
|:---------|:-----------------:|:-----------|
| file | Filepath | The file to write the log into |
| level | Valid log level | Log level to use |
| toFile | `true` or `false` | When true the log will be written to the value of the `file` option |
| guiDebug | `true` or `false` | When true the log will show the Gui's internal debug messages |
### Security
This section contains options used by the application security it will begin with `[security]`
The `deskflow-server` command accepts the `-c` or `--config` option, which takes one argument,
the path to a server configuration file. When using the GUI the `internalConfig` section of the GUI settings will be exported as the server configuration.
The configuration file is plain text and case-sensitive. The file is broken into sections, and each section has the form:
```
section: ''name''
''arg'' = ''value''
end
```
Comments are introduced by ''#'' and continue to the end of the line. ''name'' must be one of the following:
* ''screens''
* ''aliases''
* ''links''
* ''options''
The file is parsed top to bottom and names cannot be used before they've been defined in the <code>screens</code> or <code>aliases</code> sections. So the <code>links</code> and <code>aliases</code> must appear after the <code>screens</code> and <code>links</code> cannot refer to aliases unless the <code>aliases</code> appear before the <code>links</code>.
### The screens section
''args'' is a list of computer names, one name per line, each followed by a colon. Names are arbitrary strings but they must be unique. The hostname of each computer is recommended. (This is the computer's network name on win32 and the name reported by the program hostname on Unix and OS X. Note that OS X may append .local to the name you gave your computer; e.g. somehost.local.) There must be a computer name for the server and each client. Each computer can specify a number of options. Options have the form name = value and are listed one per line after the computer name.
```
section: screens
moe:
larry:
halfDuplexCapsLock = true
halfDuplexNumLock = true
curly:
meta = alt
end
```
This declares three computers named ''moe'', ''larry'', and ''curly''. Computer ''larry'' has half-duplex ''Caps Lock'' and ''Num Lock'' keys (see below) and computer ''curly'' converts the ''Meta'' modifier key to the ''Alt'' modifier key.
#### screen options
A computer can have the following options:
|Option | Valid Values| Description|
|:----------|:-----------:|:-----------|
|halfDuplexCapsLock| `true` or `false` | This computer has a ''Caps Lock'' key that doesn't report a press and a release event when the user presses it but instead reports a press event when it's turned on and a release event when it's turned off. If ''Caps Lock'' acts strangely on all computers then you may need to set this option to true on the server. If it acts strangely on one computer then that computer may need the option set to true.|
|halfDuplexNumLock | `true` or `false` | This computer has a ''Num Lock'' key that doesn't report a press and a release event when the user presses it but instead reports a press event when it's turned on and a release event when it's turned off. If ''Num Lock'' acts strangely on all computers then you may need to set this option to true on the server. If it acts strangely on one computer then that computer may need the option set to true.|
|halfDuplexScrollLock| `true` or `false`| This computer has a ''Scroll Lock'' key that doesn't report a press and a release event when the user presses it but instead reports a press event when it's turned on and a release event when it's turned off. If ''Scroll Lock'' acts strangely on all computers then you may need to set this option to true on the server. If it acts strangely on one computer then that computer may need the option set to true.|
|xtestIsXineramaUnaware| `true` or `false`| This option works around a bug in the XTest extension when used in combination with Xinerama. It affects X11 clients only. Not all versions of the XTest extension are aware of the Xinerama extension. As a result, they do not move the mouse correctly when using multiple Xinerama screens. This option is currently ''true'' by default. If you know your XTest extension is Xinerama aware then set this option to ''false''.|
|preserveFocus| `true` or `false` | When true don't drop focus when switching computers
|switchCornerSize | integer | see switchCornerSize below.|
|shift | shift ctrl alt meta super none | Map the server's shift modifer to different key on a client computer|
|ctrl | shift ctrl alt meta super none | Map the server's ctrl modifer to different key on a client computer|
|alt | shift ctrl alt meta super none | Map the server's alt modifer to different key on a client computer|
|meta| shift ctrl alt meta super none | Map the server's meta modifer to different key on a client computer|
|super| shift ctrl alt meta super none | Map the server's super modifer to different key on a client computer|
### aliases section
''args'' is a list of computer names just like in the ''screens'' section except each computer is followed by a list of aliases, one per line, not followed by a colon. An ''alias'' is a computer name and must be unique. When searching for computers each alias is equivalent to the computer name it aliases. So a client can connect using its canonical computer name or any of its aliases.
```
section: aliases
larry:
larry.stooges.com
curly:
shemp
end
```
Computer ''larry'' is also known as ''larry.stooges.com'' and can connect as either name. Computer ''curly'' is also known as ''shemp'' (hey, it's just an example).
### links secion
''args'' is a list of computer names just like in the ''screens'' section except each computer is followed by a list of links, one per line. Each link has the form:
```
{left|right|up|down}[<range>] = name[<range>]
```
A link indicates which computer is adjacent in the given direction.
Each side of a link can specify a range which defines a portion of an edge. A range on the direction is the portion of edge you can leave from while a range on the computer is the portion of edge you'll enter into. Ranges are optional and default to the entire edge. All ranges on a particular direction of a particular computer must not overlap.
A ''range'' is written as <code>(start,end)</code>. Both ''start'' and ''end'' are percentages in the range 0 to 100, inclusive. The start must be less than the end. 0 is the left or top of an edge and 100 is the right or bottom.
```
section: links
moe:
right = larry
up(50,100) = curly(0,50)
larry:
left = moe
up(0,50) = curly(50,100)
curly:
down(0,50) = moe
down(50,100) = larry(0,50)
end
```
This indicates that computer ''larry'' is to the right of computer ''moe'' (so moving the cursor off the right edge of ''moe'' would make it appear at the left edge of ''larry''), the left half of curly is above the right half of ''moe'', ''moe'' is to the left of ''larry'' (edges are not necessarily symmetric so you have to provide both directions), the right half of curly is above the left half of ''larry'', all of ''moe'' is below the left half of ''curly'', and the left half of ''larry'' is below the right half of ''curly''.
Note that links do not have to be symmetrical; for instance, here the edge between ''moe'' and ''curly'' maps to different ranges depending on if you're going up or down. In fact links don't have to be bidirectional. You can configure the right of ''moe'' to go to ''larry'' without a link from the left of ''larry'' to ''moe''. It's possible to configure a computer with no outgoing links; the cursor will get stuck on that computer unless you have a hot key configured to switch off of that computer.
### options section
''args'' is a list of lines of the form <code>name = value</code>. These set the global options.
```
section: options
protocol = barrier
heartbeat = 5000
switchDelay = 500
end
```
#### List of options allowed in options section
| Options | Value Values| Description|
|:--------|:-----------:|:-----------|
|protocol | barrier or synergy| The protocol to use when saying hello to clients. Can be set to barrier or synergy. If not set barrier is used as the default |
|heartbeat| integer (N) | The server will expect each client to send a message no less than every `N` milliseconds. If no message arrives from a client within `3N` seconds the server forces that client to disconnect. If deskflow fails to detect clients disconnecting while the server is sleeping or vice versa, try using this option. |
|switchCorners | none top-left top-right bottom-left bottom-right left right top bottom all | Deskflow won't switch computers when the mouse reaches the edge of the computer if it's in a listed corner. The size of all corners is given by the `switchCornerSize` option. The first name in the list is one of the above names and defines the initial set of corners. Subsequent names are prefixed with + or - to add the corner to or remove the corner from the set, respectively. For example: `all -left +top-left` starts will all corners, removes the left corners (top and bottom) then adds the top-left back in, resulting in the top-left, bottom-left and bottom-right corners.|
|switchCornerSize | integer (N) | Sets the size of all corners in pixels. The cursor must be within `N` pixels of the corner to be considered to be in the corner.|
|switchDelay | integer| Deskflow won't switch computers when the mouse reaches edge of a computer unless it stays on the edge for `N` milliseconds. This helps prevent unintentional switching when working near an edge.|
|switchDoubleTap| integer(N) | Deskflow won't switch computers when the mouse reaches the edge of a computer unless it's moved away from the edge and then back to the edge within `N` milliseconds. With the option you have to quickly tap the edge twice to switch. This helps prevent unintentional switching when working near the edge.|
|screenSaverSync| `true` or `false`| ''Note: Removed in v1.14.1'' If set to ''false'' then Deskflow won't synchronize screen savers. Client screen savers will start according to their individual configurations. The server screen saver won't start if there is input, even if that input is directed toward a client computer.|
|relativeMouseMoves| `true` or `false`| If set to ''true'' then secondary computers move the mouse using relative rather than absolute mouse moves when and only when the cursor is locked to the computer (by ''Scroll Lock'' or a configured hot key). This is intended to make Deskflow work better with certain games. If set to ''false'' or not set then all mouse moves are absolute.|
|clipboardSharing| `true` or `false`|If set to ''true'' then clipboard sharing will be enabled and the ''clipboardSharingSize'' setting will be used. If set to false, then clipboard sharing will be disabled and the the ''clipboardSharingSize'' setting will be ignored.|
|clipboardSharingSize| integer (N)| Deskflow will send a maximum of `N` kilobytes of clipboard data to another computer when the mouse transitions to that computer.|
|win32KeepForeground | `true` or `false`| If set to ''true'' (the default), Deskflow will grab the foreground focus on a Windows server (thereby putting all other windows in the background) upon switching to a client. If set to ''false'', it will leave the currently foreground window in the foreground. Deskflow grabs the focus to avoid issues with other apps interfering with Deskflow's ability to read the hardware inputs. |
|keystroke(key) | actions | Binds the ''key'' combination key to the given ''actions''. ''key'' is an optional list of modifiers (''shift'', ''control'', ''alt'', ''meta'' or ''super'') optionally followed by a character or a key name, all separated by + (plus signs). You must have either modifiers or a character/key name or both. See below for `valid key names` and `actions`. Keyboard hot keys are handled while the cursor any computer. Separate actions can be assigned to press and release.|
|mousebutton(button) | actions| Binds the modifier and mouse button combination ''button'' to the given ''actions''. ''button'' is an optional list of modifiers (''shift'', ''control'', ''alt'', ''meta'' or ''super'') followed by a button number. The primary button (the left button for right handed users) is button 1, the middle button is 2, etc. Actions can be found below. Mouse button actions are not handled while the cursor is on the server. You cannot use these to perform an action while on the server. Separate actions can be assigned to press and release.|
You can use both the ''switchDelay'' and ''switchDoubleTap'' options at the same time. Deskflow will switch when either requirement is satisfied.
##### Actions
Actions are two lists of individual actions separated by commas. The two lists are separated by a '';'' (semicolon). Either list can be empty and if the second list is empty then the semicolon is optional. The first list lists actions to take when the condition becomes true (e.g. the hot key or mouse button is pressed) and the second lists actions to take when the condition becomes false (e.g. the hot key or button is released). The condition becoming true is called activation and becoming false is called deactivation. Allowed individual actions are:
*`keystroke(key[,computers])`
*`keyDown(key[,computers])`
*`keyUp(key[,computers])`
: Synthesizes the modifiers and key given in ''key'' which has the same form as described in the ''keystroke'' option. If given, ''computers'' lists the computer or computers to direct the event to, regardless of the active computer. If not given then the event is directed to the active computer only.
: ''keyDown'' synthesizes a key press and ''keyUp'' synthesizes a key release. ''keystroke'' synthesizes a key press on activation and a release on deactivation and is equivalent to a ''keyDown'' on activation and ''keyUp'' on deactivation.
: ''computers'' is either ''*'' (asterisk) to indicate all computers or a '':'' (colon) separated list of computer names. (Note that the computer name must have already been encountered in the configuration file so you'll probably want to put ''actions'' at the bottom of the file.)
*`mousebutton(button)`
*`mouseDown(button)`
*`mouseUp(button)`
: Synthesizes the modifiers and mouse button given in ''button'' which has the same form as described in the ''mousebutton'' option.
: ''mouseDown'' synthesizes a mouse press and ''mouseUp'' synthesizes a mouse release. ''mousebutton'' synthesizes a mouse press on activation and a release on deactivation and is equivalent to a ''mouseDown'' on activation and ''mouseUp'' on deactivation.
*`lockCursorToScreen(mode)`
: Locks the cursor to or unlocks the cursor from the active computer. ''mode'' can be ''off'' to unlock the cursor, ''on'' to lock the cursor, or ''toggle'' to toggle the current state. The default is ''toggle''. If the configuration has no ''lockCursorToScreen'' action and ''Scroll Lock'' is not used as a hot key then ''Scroll Lock'' toggles cursor locking.
*`switchToScreen(computerName)`
: Jump to computer with name or alias ''computerName''.
*`switchInDirection(dir)`
: Switch to the computer in the direction ''dir'', which may be one of ''left'', ''right'', ''up'' or ''down''.
*`switchToNextScreen()`
: Cycle to the next computer in the configuration order. If at the last computer, cycles back to the first computer.
##### Keynames
Valid key names are:
<details><summary>Valid Key Names</summary>
* AppMail
* AppMedia
* AppUser1
* AppUser2
* AudioDown
* AudioMute
* AudioNext
* AudioPlay
* AudioPrev
* AudioStop
* AudioUp
* BackSpace
* Begin
* Break
* Cancel
* CapsLock
* Clear
* Delete
* Down
* Eject
* End
* Escape
* Execute
* F1
* F2
* F3
* F4
* F5
* F6
* F7
* F8
* F9
* F10
* F11
* F12
* F13
* F14
* F15
* F16
* F17
* F18
* F19
* F20
* F21
* F22
* F23
* F24
* F25
* F26
* F27
* F28
* F29
* F30
* F31
* F32
* F33
* F34
* F35
* Find
* Help
* Home
* Insert
* KP_0
* KP_1
* KP_2
* KP_3
* KP_4
* KP_5
* KP_6
* KP_7
* KP_8
* KP_9
* KP_Add
* KP_Begin
* KP_Decimal
* KP_Delete
* KP_Divide
* KP_Down
* KP_End
* KP_Enter
* KP_Equal
* KP_F1
* KP_F2
* KP_F3
* KP_F4
* KP_Home
* KP_Insert
* KP_Left
* KP_Multiply
* KP_PageDown
* KP_PageUp
* KP_Right
* KP_Separator
* KP_Space
* KP_Subtract
* KP_Tab
* KP_Up
* Left
* LeftTab
* Linefeed
* Menu
* NumLock
* PageDown
* PageUp
* Pause
* Print
* Redo
* Return
* Right
* ScrollLock
* Select
* Sleep
* Space
* SysReq
* Tab
* Undo
* Up
* WWWBack
* WWWFavorites
* WWWForward
* WWWHome
* WWWRefresh
* WWWSearch
* WWWStop
* Space
* Exclaim
* DoubleQuote
* Number
* Dollar
* Percent
* Ampersand
* Apostrophe
* ParenthesisL
* ParenthesisR
* Asterisk
* Plus
* Comma
* Minus
* Period
* Slash
* Colon
* Semicolon
* Less
* Equal
* Greater
* Question
* At
* BracketL
* Backslash
* BracketR
* Circumflex
* Underscore
* Grave
* BraceL
* Bar
* BraceR
* Tilde
</details>
Additionally, a name of the form `\uXXXX` where ''XXXX'' is a hexadecimal number is interpreted as a unicode character code. Key and modifier names are case-insensitive. Keys that don't exist on the keyboard or in the default keyboard layout will not work.
### Example textual configuration file
This example comes from doc/deskflow-basic.conf
```
# sample deskflow configuration file
#
# comments begin with the # character and continue to the end of
# line. comments may appear anywhere the syntax permits.
# +-------+ +--------+ +---------+
# |Laptop | |Desktop1| |iMac |
# | | | | | |
# +-------+ +--------+ +---------+
section: screens
# three hosts named: Laptop, Desktop1, and iMac
# These are the nice names of the hosts to make it easy to write the config file
# The aliases section below contain the "actual" names of the hosts (their hostnames)
Laptop:
Desktop1:
iMac:
end
section: links
# iMac is to the right of Desktop1
# Laptop is to the left of Desktop1
Desktop1:
right(0,100) = iMac # the numbers in parentheses indicate the percentage of the computer's edge to be considered active for switching)
left = Laptop
shift = shift (shift, alt, super, meta can be mapped to any of the others)
# Desktop1 is to the right of Laptop
Laptop:
right = Desktop1
# Desktop1 is to the left of iMac
iMac:
left = Desktop1
end
section: aliases
# The "real" name of iMac is John-Smiths-iMac-3.local.
# If we wanted we could remove this alias and instead use John-Smiths-iMac-3.local everywhere iMac is above.
# Hopefully it should be easy to see why using an alias is nicer
iMac:
John-Smiths-iMac-3.local
end
```
#### Cursor Wrapping
The text config allows computers to be wrapped around. For example, with two machines (a server and a client), the mouse can go off the right of the server onto the left side of the client, then off the right side of the client back onto the left side of server. This config also uses ''Ctrl''+''Super''+(''left arrow''/''right arrow'') to switch between machines on keypress.
```
# Physical monitor arrangement, with machine names as used by Deskflow.
# +----------+----------+
# | syn-serv | syn-cli |
# | | |
# +----------+----------+
section: screens
syn-serv:
syn-cli:
end
section: links
syn-serv:
left = syn-cli # "wrapping" arrangement
right = syn-cli # "normal" arrangement
syn-cli:
left = syn-serv # "normal"
right = syn-serv # "wrapping"
end
section: options
keystroke(control+super+right) = switchInDirection(right) # Switch computers on keypress
The following screen config allows the mapping for ''Alt'' to ''AltGr''. Although this may not work, see [https://github.com/deskflow/deskflow-core/issues/4411 bug #4411].
```
section: screens
client1:
altgr = alt # mapping to fix AltGr key not working on windows clients (e.g. @-Symbol etc.).
end
```
See also: the man page for ''deskflow-core''.
### Stacked Example
Stack one computer on top of another's.
```
# +-------+
# | curly |
# | |
# +-------+
# +-------+ +-------+
# | moe | | larry |
# | | | |
# +-------+ +-------+
section: screens
# three hosts named: moe, larry, and curly
moe:
larry:
curly:
end
section: links
# larry is to the right of moe and curly is above moe.
moe:
right = larry
up = curly
# moe is to the left of larry and curly is above larry.
larry:
left = moe
up = curly
# larry is below curly.
curly:
down = larry
end
section: aliases
# curly is also known as shemp
curly:
shemp
end
```
### Horizontal Example
Align all computers horizontally.
```
# +-------+ +-------+ +-------+
# | moe | | larry | | curly |
# | | | | | |
# +-------+ +-------+ +-------+
section: screens
# three hosts named: moe, larry, and curly
moe:
larry:
curly:
end
section: links
# curly is to the right of larry and moe is to the left of larry.
larry:
right = curly
left = moe
# larry is to the right of moe.
moe:
right = larry
# larry is to the left of curly.
curly:
left = larry
end
```
### Span Example
Span one computer across the two other computers.
```
# +-------+ +-------+
# | curly | | curly |
# | | | |
# +-------+ +-------+
# +-------+ +-------+
# | moe | | larry |
# | | | |
# +-------+ +-------+
section: screens
# three hosts named: moe, larry, and curly
moe:
larry:
curly:
end
section: links
# larry is to the right of moe and curly is above moe.
moe:
right = larry
up = curly
# moe is to the left of larry and curly is above larry.
<pathstyle="fill:currentColor;fill-opacity:1;stroke:none"d="M 13.300781 2 L 10.650391 4.6503906 L 9.5859375 3.5859375 L 3.5859375 9.5859375 L 4.6503906 10.650391 L 2 13.300781 L 2.6992188 14 L 5.3496094 11.349609 L 6.4140625 12.414062 L 12.414062 6.4140625 L 11.349609 5.3496094 L 14 2.6992188 L 13.300781 2 z "class="ColorScheme-Text"/>
<pathstyle="fill:currentColor;fill-opacity:1;stroke:none"d="M 13.300781 2 L 10.650391 4.6503906 L 9.5859375 3.5859375 L 6.5859375 6.5859375 L 9.4140625 9.4140625 L 12.414062 6.4140625 L 11.349609 5.3496094 L 14 2.6992188 L 13.300781 2 z M 5.5859375 7.5859375 L 3.5859375 9.5859375 L 4.6503906 10.650391 L 2 13.300781 L 2.6992188 14 L 5.3496094 11.349609 L 6.4140625 12.414062 L 8.4140625 10.414062 L 5.5859375 7.5859375 z "class="ColorScheme-Text"/>
<pathclass="ColorScheme-Text"d="M 4,8.999786 H 4.9999606 V 7.657389 L 4.9999596,6.707213 7.8928452,9.590171 8.6,8.883065 5.7110623,5.999946 l 0.9502006,1e-6 1.3391875,-1e-6 -4.666e-4,-0.999893 H 6.6612619 L 4.0004131,5 4,7.657388 Z"fill="currentColor"/>
<pathstyle="fill:currentColor;fill-opacity:1;stroke:none"d="M 18.292969 3 L 14.792969 6.5 L 13.292969 5 L 11.292969 7 L 8 10.292969 L 6 12.292969 L 7.5 13.792969 L 3 18.292969 L 3.7070312 19 L 8.2070312 14.5 L 9.7070312 16 L 11.707031 14 L 15 10.707031 L 17 8.7070312 L 15.5 7.2070312 L 19 3.7070312 L 18.292969 3 z "class="ColorScheme-Text"/>
<pathstyle="fill:currentColor;fill-opacity:1;stroke:none"d="M 18.292969 3 L 14.792969 6.5 L 13.292969 5 L 11.292969 7 L 9.5 8.7929688 L 11 10.292969 L 11.707031 11 L 13.207031 12.5 L 15 10.707031 L 17 8.7070312 L 15.5 7.2070312 L 19 3.7070312 L 18.292969 3 z M 8.7929688 9.5 L 8 10.292969 L 6 12.292969 L 7.5 13.792969 L 3 18.292969 L 3.7070312 19 L 8.2070312 14.5 L 9.7070312 16 L 11.707031 14 L 12.5 13.207031 L 11 11.707031 L 10.292969 11 L 8.7929688 9.5 z "class="ColorScheme-Text"/>
<pathstyle="fill:currentColor;fill-opacity:1;stroke:none"d="M 14.833984 14 L 14 14.833984 L 15.666016 16.5 L 14 18.166016 L 14.833984 19 L 16.5 17.333984 L 18.166016 19 L 19 18.166016 L 17.333984 16.5 L 19 14.833984 L 18.166016 14 L 16.5 15.666016 L 14.833984 14 z "class="ColorScheme-NegativeText"/>
<pathstyle="fill:currentColor;fill-opacity:1;stroke:none"d="M 3 3 L 3 19 L 19 19 L 19 3 L 3 3 z M 4 7 L 18 7 L 18 18 L 4 18 L 4 7 z "class="ColorScheme-Text"/>
<pathstyle="fill:#da4453;fill-opacity:1;stroke:none"d="M 8.7070312 9 L 8 9.7070312 L 10.292969 12 L 8 14.292969 L 8.7070312 15 L 11 12.707031 L 13.292969 15 L 14 14.292969 L 11.707031 12 L 14 9.7070312 L 13.292969 9 L 11 11.292969 L 8.7070312 9 z "/>
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.