deskhop: Fast Desktop Switching Device
deskhop: Fast Desktop Switching Device
deskhop:快速桌面切换设备
DeskHop - Fast Desktop Switching Did you ever notice how, in the crazy world of tech, there’s always that one quirky little project trying to solve a problem so niche that its only competitors might be a left-handed screwdriver and a self-hiding alarm clock? I use two different computers in my daily workflow and share a single keyboard/mouse pair between them. Trying several USB switching boxes found on Amazon made me realize they all suffer from similar issues - it takes a while to switch, the process is quite clumsy when trying to find the button and frankly, it just doesn’t get any better with time. All I wanted was a way to use a keyboard shortcut to quickly switch outputs, paired with the ability to do the same by magically moving the mouse pointer between monitors. This project enables you to do both, even if your computers run different operating systems!
DeskHop - 快速桌面切换。你是否注意到,在疯狂的科技世界里,总有那么一些古怪的小项目,试图解决一个极其冷门的问题,以至于它唯一的竞争对手可能只是左手螺丝刀或会自动隐藏的闹钟?我在日常工作中需要使用两台不同的电脑,并共用一套键盘和鼠标。我尝试了亚马逊上能找到的几种 USB 切换器,发现它们都有类似的问题——切换速度慢、寻找按钮的过程笨拙,而且坦白说,这些问题随着时间的推移并没有任何改善。我想要的只是通过键盘快捷键快速切换输出,并能通过将鼠标指针在显示器之间“神奇地”移动来实现同样的操作。这个项目让你两者兼得,即使你的电脑运行的是不同的操作系统!
Features
功能特点
-
Completely free and open source
-
No noticeable delay when switching
-
Simply drag the mouse pointer between computers
-
No software installed
-
Affordable and obtainable components (<15€)
-
3D printable snap-fit case
-
Full Galvanic isolation between your outputs
-
Works with Linux, macOS and Windows
-
User Manual is now available
-
完全免费且开源
-
切换时无明显延迟
-
只需在电脑之间拖动鼠标指针即可
-
无需安装任何软件
-
组件经济实惠且易于获取(<15欧元)
-
可 3D 打印的卡扣式外壳
-
输出端之间完全电气隔离
-
支持 Linux、macOS 和 Windows
-
用户手册现已发布
How it works
工作原理
The device acts as an intermediary between your keyboard/mouse and the computer, establishing and maintaining connections with both computers at once. Then it chooses where to forward your mouse and keystrokes to, depending on your selection. Keyboard follows the mouse and vice versa, so just dragging the mouse to the other desktop will switch both.
该设备充当键盘/鼠标与电脑之间的中介,同时与两台电脑建立并保持连接。然后,它根据你的选择决定将鼠标和按键信号转发到哪里。键盘跟随鼠标,反之亦然,因此只需将鼠标拖动到另一个桌面,即可同时切换两者。
Mouse
鼠标
To get the mouse cursor to magically jump across, the mouse hid report descriptor was changed to use absolute coordinates and then the mouse reports (that still come in relative movements) accumulate internally, keeping the accurate tally on the position. When you try to leave the monitor area in the direction of the other monitor, it keeps the Y coordinate and swaps the maximum X for a minimum X, then flips the outputs. This ensures that the cursor seamlessly appears at the same height on the other monitor, enhancing the perception of a smooth transition. Dragging the mouse from Mac to Linux automatically switches outputs. The actual switch happens at the very moment when one arrow stops moving and the other one starts.
为了让鼠标光标“神奇地”跨屏跳转,鼠标的 HID 报告描述符被修改为使用绝对坐标,随后鼠标报告(仍以相对位移形式发送)会在内部进行累加,从而保持对位置的精确计算。当你试图向另一台显示器的方向移出当前屏幕区域时,它会保留 Y 坐标,并将最大 X 坐标与最小 X 坐标互换,然后切换输出端。这确保了光标能无缝地出现在另一台显示器的相同高度,增强了平滑过渡的体验。将鼠标从 Mac 拖动到 Linux 会自动切换输出。实际的切换发生在一侧箭头停止移动而另一侧箭头开始移动的那一瞬间。
Keyboard
键盘
Acting as a USB Host and querying your keyboard periodically, it looks for a preconfigured hotkey in the hid report (usually Ctrl + Caps Lock for me). When found, it will forward all subsequent characters to the other output. To have a visual indication which output you are using at any given moment, you can repurpose keyboard LEDs and have them provide the necessary feedback. It also remembers the LED state for each computer, so you can pick up exactly how you left it.
作为 USB 主机并定期查询键盘,它会在 HID 报告中查找预配置的热键(我通常设置为 Ctrl + Caps Lock)。一旦找到,它就会将后续的所有字符转发到另一个输出端。为了直观地显示你当前正在使用哪个输出端,你可以重新利用键盘上的 LED 灯来提供必要的反馈。它还会记住每台电脑的 LED 状态,这样你就可以在切换后保持之前的设置。
How to build
如何构建
To avoid version mismatch and reported path issues when building, as well as to save you from having to download a large SDK, the project now bundles minimal pico sdk and tinyusb. On a Debian/Ubuntu systems, make sure to install these:
apt update
apt install build-essential cmake gcc-arm-none-eabi libnewlib-arm-none-eabi python3
为了避免构建时的版本不匹配和路径问题,并省去下载大型 SDK 的麻烦,该项目现在捆绑了精简版的 pico sdk 和 tinyusb。在 Debian/Ubuntu 系统上,请确保安装以下内容:
apt update
apt install build-essential cmake gcc-arm-none-eabi libnewlib-arm-none-eabi python3
You should be able to build by running:
cmake -S . -B build
cmake --build build
你应该可以通过运行以下命令进行构建:
cmake -S . -B build
cmake --build build
Upgrading firmware
固件升级
Option 1 - (firmware 0.6 and later) Put the device in “config mode” by simultaneously pressing left ctrl + right shift + c + o. Device your keyboard is plugged into will reboot and turn into a USB drive called “DESKHOP”. All you need to do is copy the .uf2 file to it. Once image is verified, device will flash and reboot, then proceed to upgrade the other board.
选项 1 -(固件 0.6 及更高版本) 同时按下左 Ctrl + 右 Shift + c + o,将设备置于“配置模式”。你键盘所连接的设备将重启并变成一个名为“DESKHOP”的 USB 驱动器。你只需将 .uf2 文件复制到其中即可。镜像验证完成后,设备将进行刷写并重启,然后继续升级另一块板子。
Misc features
其他功能
-
Mouse slowdown: Press right CTRL + right ALT to toggle a slow-mouse mode.
-
Switch Lock: Use RIGHT CTRL + K to lock yourself to one screen.
-
Lock Both Screens: Use RIGHT CTRL + L to lock both computers at once.
-
Gaming Mode: If you’re gaming, there is…
-
鼠标减速: 按下右 CTRL + 右 ALT 可切换鼠标减速模式。
-
切换锁定: 使用右 CTRL + K 将自己锁定在一个屏幕上。
-
锁定双屏: 使用右 CTRL + L 同时锁定两台电脑。
-
游戏模式: 如果你正在玩游戏,这里有……