站内搜索
发作品签到
专业版

DESKHOP两台电脑键盘鼠标共享器-基于RP2040芯片

工程标签

2.4k
0
0
19

简介

这是一个用于两台电脑共享一套键盘鼠标的小东西,移动鼠标,键鼠就可以在两台电脑间自由切换,相当丝滑!基于Git上一个开源作品重新设计了PCB板,更小巧简洁,测试功能完全没有问题!

简介:这是一个用于两台电脑共享一套键盘鼠标的小东西,移动鼠标,键鼠就可以在两台电脑间自由切换,相当丝滑!基于Git上一个开源作品重新设计了PCB板,更小巧简洁,测试功能完全没有问题!

开源协议

GPL 3.0

创建时间:2024-04-12 00:46:27更新时间:2024-08-19 10:03:41

描述

这是一个用于两台电脑共享一套键盘鼠标的小东西,移动鼠标,键鼠就可以在两台电脑间自由切换,相当丝滑!

原作Git链接:https://github.com/hrvach/deskhop

我只重新设计了PCB,开源软件还用原作者的!

 

已测试有线鼠标,2.4G无线鼠标支持都没问题,蓝牙鼠标不支持!键盘测试了我自制的机械键盘和普通有线键盘,自制键盘有线模式没问题,蓝牙模式则不支持,有线键盘我有一款Dell的键盘也不行,插入一直输入空格键不知道什么原因!

操作系统测试了Win10 Win7 WinXP和纯国产电脑龙芯CPU操作系统为中标麒麟,都没有问题,测试见附件两个视频!

 

使用方法:

1.刷入固件方法:开关拨到A,插入电脑,电脑会出现个U盘,将board_A.uf2文件复制到新出现的RP U盘中!

                            开关拨到B,插入电脑,电脑会出现个U盘,将board_B.uf2文件复制到新出现的RP U盘中!

2.使用:放置在左边的电脑使用type-c线插入B接口,右边的电脑则插入A接口,开关随便拨到A或B都可以,拨到哪里整个器件和键盘鼠标就由哪台电脑供电!鼠标从B电脑的右边再往右移就会出现在A电脑的屏幕中,此时键盘鼠标就对A电脑起作用;反之,从A电脑左边往左移就会出现在B电脑屏幕,此时键鼠作用于A电脑!

 

原作PCB:用的是两块Pico开发板设计的底板!

我的PCB:基于两颗RP2040芯片设计,小巧优雅多了!

原作的介绍:(复制自Github)

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.

Keyboard

Acting as a USB Host and querying your keyboard periodically, it looks for a preconfigured hotkey in the hid report (usually 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.

 

Upgrading firmware

Option 1 - Open the case, hold the button while connecting each Pico and copy the right uf2 to it.

Option 2 - Switch a board to BOOTSEL mode by using a special key combination (listed below).

This will make the corresponding Pico board enter the bootloader upgrade mode and act as USB flash drive. Now you can drag-and-drop the .uf2 file to it (you might need to plug in your mouse directly).

Misc features

Mouse slowdown

Ever tried to move that YT video slider to a specific position but your mouse moves too jumpy and suddenly you are moving your hand super-carefully like you're 5 and playing "Operation" all over again?

Press right CTRL + right ALT to toggle a slow-mouse mode. The mouse pointer will slow down considerably, enabling you to get the finer precision work done and still have your mouse moving normally by quickly pressing the same keys again.

Switch Lock

If you want to lock yourself to one screen, use RIGHT CTRL + L. This will make sure you won't accidentally leave your current screen. To turn off, press the same key combo again.

Screensaver

Supposedly built in to prevent computer from entering standby, but truth be told - it is just fun to watch. Off by default, will make your mouse pointer bounce around the screen like a Pong ball. When enabled, it activates after a period of inactivity defined in user config header and automatically switches off as soon as you send any output towards that screen.

Potential usage example - I have a buggy USB dock that won't resume video from standby, so not allowing it to sleep can be a handy workaround.

 

Usage guide

Keyboard shortcuts

Firmware upgrade

  • Right Shift + F12 + Left Shift + A - put board A in FW upgrade mode
  • Right Shift + F12 + Left Shift + B - put board B in FW upgrade mode

Usage

  • Right CTRL + Right ALT - Toggle slower mouse mode
  • Right CTRL + L - Lock/Unlock mouse desktop switching
  • Right ALT + Right Shift + L - Lock both outputs at once (set output OS before, see shortcuts below)
  • Caps Lock - Switch between outputs

Config

  • Right Shift + F12 + D - remove flash config
  • Right Shift + F12 + Y - save screen switch offset
  • Right Shift + F12 + S - turn on/off screensaver option

Number of outputs

  • Right Shift + Backspace + 1 - set number of screens to 1 on current active output
  • Right Shift + Backspace + 2 - set number of screens to 2 on current active output

Set operating systems

  • Right Shift + Backspace + 7 - set os to Linux on current active output
  • Right Shift + Backspace + 8 - set os to Windows on current active output
  • Right Shift + Backspace + 9 - set os to MacOS on current active output

Switch cursor height calibration

This step is not required, but it can be handy if your screens are not perfectly aligned or differ in size. The objective is to have the mouse pointer come out at exactly the same height.

Just park your mouse on the LARGER screen at the height of the smaller/lower screen (illustrated) and press Right Shift + F12 + Y. Your LED (and caps lock) should flash in confirmation.

Repeat for the bottom border (if it's above the larger screen's border). This will get saved to flash and it should keep this calibration value from now on.

Multiple screens per output

Windows and Mac have issues with multiple screens and absolute positioning, so workarounds are needed (still experimental). Your main screens need to be in the middle, and secondary screen(s) on the edges. Move the mouse to the screen with multiple desktops and press right shift + backspace + 2 if you have 2 desktops and right shift + backspace + 7, 8 or 9 depending on your OS (Linux, Windows, Mac).

Other configuration

Mouse speed can now be configured per output screen and per axis. If you have multiple displays under Linux, your X speed might be too fast, so you need to configure it in user_config.h and rebuild. In the future, this will be configurable without having to do that.

Functional verification

When you connect a new USB peripheral, the board will flash the led twice, and instruct the other board to do the same. This way you can test if USB and outgoing communication works for each board.

Do this test by first plugging the keyboard on one side and then on the other. If everything is OK, leds will flash quickly back and forth in both cases.

Security and Safety

Some features are missing on purpose, despite the fact it would make the device easier to use or simpler to configure. Here is a quick breakdown of these decisions:

  • There is no copy-paste or any information sharing between systems. This prevents information leakage.
  • No webhid device management or any inbound connectivity from the output computers, with the only exception of standard keyboard LED on/off messages, hard limited to 1 byte of data.
  • No FW upgrade triggering from the outputs. Only explicit and deliberate user action through a special keyboard shortcut may do that.
  • No plugged-in keyboard/mouse custom endpoints are exposed or information forwarded towards these devices. Their potential vulnerabilities are effectively firewalled from the computer.
  • No input history is allowed to be retained.
  • Outputs are physically separated and galvanically isolated with a minimal isolation voltage of 2kV.
  • All packets exchanged between devices are of fixed length, no code is transferred and no raw config exchange of any kind can take place.
  • There is no bluetooth or wifi, networking, Internet access, usb drives etc.
  • No connected computer is considered trusted under any circumstances.
  • Entirety of the code is open source, without any binary blobs and thoroughly commented to explain its purpose. I encourage you to never trust anyone and always make sure you know what you are running by doing a manual audit.

This still doesn't guarantee anything, but I believe it makes a reasonable set of ground rules to keep you safe and protected.

 

 

设计图

未生成预览图,请在编辑器重新保存一次

BOM

暂无BOM

3D模型

序号文件名称下载次数
暂无数据

附件

序号文件名称下载次数
1
studio_video_1714224146745.mp4
10
2
studio_video_1714224819456.mp4
4
3
board_A.uf2
44
4
board_B.uf2
39
克隆工程
添加到专辑
0
0
分享
侵权投诉

工程成员

知识产权声明&复刻说明

本项目为开源硬件项目,其相关的知识产权归创作者所有。创作者在本平台上传该硬件项目仅供平台用户用于学习交流及研究,不包括任何商业性使用,请勿用于商业售卖或其他盈利性的用途;如您认为本项目涉嫌侵犯了您的相关权益,请点击上方“侵权投诉”按钮,我们将按照嘉立创《侵权投诉与申诉规则》进行处理。

请在进行项目复刻时自行验证电路的可行性,并自行辨别该项目是否对您适用。您对复刻项目的任何后果负责,无论何种情况,本平台将不对您在复刻项目时,遇到的任何因开源项目电路设计问题所导致的直接、间接等损害负责。

评论

全部评论(1
按时间排序|按热度排序
粉丝0|获赞0
相关工程
暂无相关工程

底部导航