鍵盤綁定

寫法很多:

0. (global-set-key "\C-l\C-l" 'redraw-display) 和 (global-set-key [?\C-x ?\C-\\] 'next-line)
1. (global-set-key [C-tab] 'my-func) 
2. (global-set-key (kbd "<C-tab>") 'my-func)
3. (global-set-key [(control tab)] 'my-func) 和 (global-set-key [(control ?x) (control ?\\)] 'next-line)


### 最原始 ( key sequence )

"\C-","\M-","\t""\r""\e","\d". 於是 , 有了 0. 中的寫法.

ref: http://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Sequences.html


### 後來 ...

kbd(read-kbd-macro) 在 Emacs 諸多版本中通用 ,  而且 , describe-key 函數的語法就是 kbd .

換而言之,你可以根據函數返回結果,作爲 設置時的 key sequence.


 RET, SPC, TAB, DEL, LFD, ESC, and NUL 代表了"控制鍵" , 並且 , 必須要 "大寫" .

而  <return>, <down>, or <f1> 這樣帶 <> 的 , 則是 "功能鍵" . <return> 和 RET 是 同義的.

ps: 但是我的host上, 只有<return> 可以工作.

ref : http://stackoverflow.com/questions/916797/emacs-global-set-key-to-c-tab


臨時結論( 就是沒有 完全驗證, 出了問題,可以進一步修正 ):

1.使用 kdb , 利用 describe-key 查找 key-sequence 的對應寫法.





`

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章