當你有兩台電腦同時需要使用的時候,就會發現多個鼠標鍵盤操作起來特別繁瑣,有沒有一個軟件可以實現多個主機共用一套鼠標鍵盤,去搜索了一下,嘿嘿,發現可以使用synergy實現這個功能
synergy介紹
synergy分為服務端和客戶端,安裝synergy的時候可以指定是服務端或客戶端,服務器端的鼠標鍵盤就可以用來控制客戶端主機,同時共用剪貼板。使用時請確認所有的主機在同一個lan下,比如連接同一個WiFi。
環境
我有兩台Windows,一台是個人筆記本(windows7),一台是公司筆記本(windows10)
下載synergy
- windows版下載鏈接
- linux版下載鏈接:
synergy安裝(Windows)
- 服務端(ip為192.168.1.6)
安裝后的界面:
激活按鈕:
激活碼生成
- 瀏覽器打開http://cpp.sh/
- 輸入以下代碼
// Example program
#include<fstream>
#include <iostream>
#include<algorithm>
#include<vector>
#include<climits>
#include<sstream>
#include<iomanip>
#include<stdexcept>
#include <string>
static std::string
hexEncode (std::string const& str) {
std::ostringstream oss;
for (size_t i = 0; i < str.size(); ++i) {
unsigned c = str[i];
c %= 256;
oss << std::setfill('0') << std::hex << std::setw(2)
<< std::uppercase;
oss << c;
}
return oss.str();
}
int main()
{
std::ostringstream oss;
oss << "{v1;pro;AVV;5;avv@avv.com;AV Computer;0;0}";
std::cout << hexEncode(oss.str());
}
-
點擊run
-
輸出結果
7B76313B70726F3B4156563B353B617676406176762E636F6D3B415620436F6D70757465723B303B307D
客戶端配置
- 客戶端(ip為192.168.1.5)
服務端IP根據實際情況填寫
設置服務端
結果驗證
如果設置正常可以拖動鼠標到另外一台主機。
或者可以嘗試在服務端主機復制一段文字,然后在客戶端嘗試黏貼。