Nokia N900 >> Maemo

定義鍵盤組合鍵


由於N900的鍵盤只有三排,缺少相當多的按鍵符號,因此,這些都需要靠組合鍵來定義,雖然組合鍵需要較多的按鍵,不過,多虧N900的鍵盤手感極佳,這樣的方式還算是可以接受,司徒如下列出自己的組合鍵設定:

# vim /usr/share/X11/xkb/symbols/nokia_vndr/rx-51
...
partial hidden alphanumeric_keys
xkb_symbols "english_base" {
  key <AD01> {[q, Q, 1, 1]};
  key <AD02> {[w, W, 2, 2]};
  key <AD03> {[e, E, 3, asciicircum]};
  key <AD04> {[r, R, 4, grave]};
  key <AD05> {[t, T, 5, 5]};
  key <AD06> {[y, Y, 6, bracketleft]};
  key <AD07> {[u, U, 7, bracketright]};
  key <AD08> {[i, I, 8, 8]};
  key <AD09> {[o, O, 9, 9]};
  key <AD10> {[p, P, 0, 0]};
  key <AB08> {[comma, semicolon, equal, equal]};

  key <AC01> {[a, A, asterisk, asterisk]};
  key <AC02> {[s, S, plus, plus]};
  key <AC03> {[d, D, numbersign, numbersign]};
  key <AC04> {[f, F, minus, asciitilde]};
  key <AC05> {[g, G, underscore, underscore]};
  key <AC06> {[h, H, parenleft, less]};
  key <AC07> {[j, J, parenright, greater]};
  key <AC08> {[k, K, ampersand]};
  key <AC09> {[l, L, exclam, bar]};
  key <AB09> {[period, colon, question, question]};

  key <AB01> {[z, Z, sterling, sterling]};
  key <AB02> {[x, X, dollar, dollar]};
  key <AB03> {[c, C, EuroSign, EuroSign]};
  key <AB04> {[v, V, slash, percent]};
  key <AB05> {[b, B, backslash, backslash]};
  key <AB06> {[n, N, quotedbl, braceleft]};
  key <AB07> {[m, M, apostrophe, braceright]};
  key <SPCE> {[space, space, at, at]};
};

partial hidden alphanumeric_keys
xkb_symbols "common_keys" {
  key <BKSP> {[BackSpace, Escape, Tab, Delete]};
  key <TAB>  {[Tab]};
  key <RTRN> {[KP_Enter, Retrun, Retrun, Return]};
  key <KPEN> {[Return]};
  key <ESC>  {[Escape]};
  key <FK01> {[F1]};
  key <FK02> {[F2]};
  key <FK03> {[F3]};
  key <FK04> {[F4]};
  key <FK05> {[F5]};
  key <FK06> {[F6]};
  key <FK07> {[F8]};
  key <FK08> {[F7]};
  key <FK09> {[F9]};
  key <FK10> {[F10]};
  key <FK11> {[F11]};
};

partial hidden alphanumeric_keys modifier_keys
xkb_symbols "modifiers" {
  key <LFSH> {
    type[Group1] = "ONE_LEVEL",
    symbols[Group1] = [Shift_L]
  };
  modifier_map Shift {Shift_L};

  key <LCTL> {
    type[Group1] = "FOUR_LEVEL",
    symbols[Group1] = [Control_L, Control_L, Multi_key, Multi_key]
  };
  modifier_map Control {Control_L};

  include "level3(ralt_switch)"
};

partial hidden alphanumeric_keys
xkb_symbols "arrows_2btns" {
  key <DOWN> {
    type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [Left, Up]
  };
  key <RIGHT> {
    type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [Right, Down]
  };
};

partial hidden alphanumeric_keys
xkb_symbols "arrows_4btns" {
  key <UP> { 
    type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [Up, Page_Up]
  };
  key <LEFT> { 
    type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [Left, KP_Home] 
  };
  key <DOWN> { 
    type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [Down, Page_Down]
  };
  key <RIGHT> {
    type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [Right, KP_End]
  };
};

鍵盤符號修改後,直接使用setxkbmap指令更新即可。

每個按鍵的定義欄位中,第一個代表單一按鍵;第二個代表加上Shift鍵;第三個代表加上Alt鍵;最後一個代表加上Shift + Alt鍵。
<AB>代表Alphanumeric的第二行(B);
<AC>代表Alphanumeric的第三行(C);
<AD>代表Alphanumeric的第四行(D);
後面的數字則是代表第幾列,如:<AB09>代表Alphanumeric的第二列第九行。
<FK>代表F0~F12 Key的意思。

接著司徒將特殊符號列出來供大家參考:

名稱符號
asciicircum^
grave`
bracketleft[
bracketright]
comma,
semicolon;
equal=
asterisk*
plus+
numbersign#
minus-
asciitilde~
underscore_
parenleft(
less<
parenright)
greater>
ampersand&
exclam!
bar|
period.
colon:
question?
sterling£
dollar$
EuroSign
slash/
percent%
backslash\
quotedbl"
braceleft{
apostrophe'
braceright}
at@

修改後的按鍵如下:

KeyShift + KeyAlt + KeyAlt + Shift + Key
qQ1q
wW2w
eE3^
rR4`
tT5t
yY6[
uU7]
iI8i
oO9o
pP0p
,;=,
backspaceescapetabbackspace
aA*a
sS+s
dD#d
fF-~
gG_g
hH(<
jJ)>
kK&k
lL!|
.:?.
zZzz
xX$x
cCcc
vV/%
bB\b
hN"{
mM'}
spacespace@space


返回上一頁