2020年12月21日 星期一

Keychorn k4 鍵盤設定

我的kvm支援共用usb設備,我把藍芽接在共用的usb上,當我切換到 win10 或 ubuntu 都可以用藍芽來連線使用Keychorn K4 鍵盤。

在 win10 中接上藍芽、鍵盤可以直接使用,最大的問題是切換到 ubuntu 時只有 y u i 幾個按鍵可用,而且按下y u i 螢幕上出現的還是數字,整個錯亂…兩天下來我發現藍芽5.0在 ubuntu 20.04 的環境中不適用,可以偵測到藍芽但怎麼就打不開,一啟動就關閉的狀態,在 GUI 工具下打不開就是打不開,後來改用藍芽4.0可以順利連線,順利連線 Keychorn 後在ubuntu中鍵位還是亂的…最後看了這篇神人的介紹後,我最後成功的做法是這樣,希望給有相同狀況的中文使用者參考

啟用 fn + f-keys (F1, F2, F3 ... F12 等功能鍵)
Step 1: Set fkeyfirst by:
        sudo vi /etc/modprobe.d/hid_apple.conf(建立hid_apple.conf檔案)
        在檔案中加入這行
        options hid_apple fnmode=0(原文中設定2不符我用,改設為0)
        存檔後執行指令
        sudo update-initramfs -u
        重新開機
Step 2: 將keychorn鍵盤切換到 Windows/Android mode
Step 3: If get stuck with numpad mode: Double hit F6 or fn + F6. I've been using this
            config since the very first day, both bluetooth and cable with no problem.
            這裡像是說如果卡在數字鍵模式,可以使用按下 fn+F6 來切換…我設定完後是沒碰到這                 狀況

Enable bluetooth fastconnect config:
編輯 /etc/bluetooth/main.conf
vi /etc/bluetooth/main.conf
找到下述行,取消註解,並將 false 改為 true
         FastConnectable = true
找到下述行,取消註解 (set the value to whatever number that you want)
        ReconnectAttempts=7
找到下述行,取消註解
        Uncomment ReconnectIntervals=1, 2, 3


Disable Autosuspend for USB Bluetooth dongles:
執行下行指令(我不是很清楚這在做什麼…整個複製然後在 terminal 下執行
echo -e "# Disable autosuspend for btusb to make the bluetooth keyboard work again\noptions btusb enable_autosuspend=n" | sudo tee /etc/modprobe.d/btusb_disable_autosuspend.conf

重新開機

Enable bluetooth after sleep:
1.Create and edit a file that will be executed every time the computer wakes up:
sudo vi /lib/systemd/system-sleep/bt
將以下內容增加在裡面
#!/bin/sh

case $1 in
  post)
    modprobe -r btusb
    sleep 1
    service bluetooth restart
    sleep 1
    modprobe btusb
    ;;
esac

2.Make it executable
sudo chmod +x /lib/systemd/system-sleep/bt


原文出處:
https://gist.github.com/andrebrait/961cefe730f4a2c41f57911e6195e444?fbclid=IwAR0JfhP6cFgq0mUmBF9QYaPjutqni6KNxJJcLu0w7UPaNKnuMlQ_iHzLTTc


沒有留言:

張貼留言