COSCUP2020
中階
TR214
歡迎來到 https://hackmd.io/@coscup/2020 共筆
請從這裡開始
講者使用很酷的人體工學鍵盤: ErgodoxTW
為了找到最適合自己的鍵盤按鍵自定義設定,需要從韌體去紀錄實際上按下了哪一個位置按鍵,而不是 ctrl
, shift
的訊號
講者使用 QMK firmware,去接受到 usb keyboard 的 debug log ?
ErgoKB:4,6,0,1,40\n
使用 golang
實作一個 HID listener
用 for loop 一直去讀 log,一個一個字元?
結果怪怪 der
cgo call 成本很高,講者做了一個 benchmark 差了幾乎將至 100 倍
解法:在 C
裡面多讀一點再丟到 golang
listener
跑起來卡住了?但每個 unit test 都過了
因為讀 HID 要一直 pulling ,其 timing 是很重要的
但 go channel 是有 lock 的,即便是 buffered channel
還是需要拿到 lock 才能寫入
因此整個程式 sequential 執行被影響到
C
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing