个人工具

“UbuntuHelp:HowToVirtualKeyboardKeymapping”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的2个中间版本)
第5行: 第5行:
 
The way it works is that it lists each keysym of the keyboard along with the corresponding note number to map to this key. You can figure out the keysym of any given key by installing and running the xkeycaps application:
 
The way it works is that it lists each keysym of the keyboard along with the corresponding note number to map to this key. You can figure out the keysym of any given key by installing and running the xkeycaps application:
 
<pre><nowiki>
 
<pre><nowiki>
sudo apt-get install xkeycaps
+
sudo apt-get install xkeycaps
xkeycaps
+
xkeycaps
 
</nowiki></pre>
 
</nowiki></pre>
 
Here is a sample of a fully-configured virtual keyboard, spanning over 3 octaves range:
 
Here is a sample of a fully-configured virtual keyboard, spanning over 3 octaves range:
第12行: 第12行:
 
global keymap
 
global keymap
 
set keymap {
 
set keymap {
{a 8}
+
  {a 8}
{z 9}
+
  {z 9}
{s 10}
+
  {s 10}
{x 11}
+
  {x 11}
{c 12}
+
  {c 12}
{f 13}
+
  {f 13}
{v 14}
+
  {v 14}
{g 15}
+
  {g 15}
{b 16}
+
  {b 16}
{n 17}
+
  {n 17}
{j 18}
+
  {j 18}
{m 19}
+
  {m 19}
{k 20}
+
  {k 20}
{comma 21}
+
  {comma 21}
{l 22}
+
  {l 22}
{period 23}
+
  {period 23}
{slash 24}
+
  {slash 24}
{apostrophe 25}
+
  {apostrophe 25}
{Shift_R 26}
+
  {Shift_R 26}
{Return 27}
+
  {Return 27}
{Tab 24}
+
  {Tab 24}
{1 25}
+
  {1 25}
{q 26}
+
  {q 26}
{2 27}
+
  {2 27}
{w 28}
+
  {w 28}
{e 29}
+
  {e 29}
{4 30}
+
  {4 30}
{r 31}
+
  {r 31}
{5 32}
+
  {5 32}
{t 33}
+
  {t 33}
{6 34}
+
  {6 34}
{y 35}
+
  {y 35}
{u 36}
+
  {u 36}
{8 37}
+
  {8 37}
{i 38}
+
  {i 38}
{9 39}
+
  {9 39}
{o 40}
+
  {o 40}
{p 41}
+
  {p 41}
{minus 42}
+
  {minus 42}
{bracketleft 43}
+
  {bracketleft 43}
{equal 44}
+
  {equal 44}
{bracketright 45}
+
  {bracketright 45}
{BackSpace 46}
+
  {BackSpace 46}
{backslash 47}
+
  {backslash 47}
 
}
 
}
 
</nowiki></pre>
 
</nowiki></pre>
Download this file: https://help.ubuntu.com/community/vkeybdmap and save it as ~?action=AttachFile&do=get&target=.vkeybdmap
+
Download this file: [[UbuntuHelp:attachment:vkeybdmap|attachment:vkeybdmap]] and save it as ~/.vkeybdmap
 
This mapping may not be perfect for your needs, but it should serve as a good starting point for you.
 
This mapping may not be perfect for your needs, but it should serve as a good starting point for you.
 
Once you have mapped all the keys how you want, be sure to start VKey``Bd with the maximum number of octaves, or else you will get weird errors when pressing keys that are not shown on screen:
 
Once you have mapped all the keys how you want, be sure to start VKey``Bd with the maximum number of octaves, or else you will get weird errors when pressing keys that are not shown on screen:
 
<pre><nowiki>
 
<pre><nowiki>
vkeybd --octave 9
+
vkeybd --octave 9
 
</nowiki></pre>
 
</nowiki></pre>
 
Test it out, and it should be working perfectly. If you want to make the default state of VKey``Bd to open up with 9 octaves, go to ''File > Save Config'' and now you do not need to specify the --octave parameter anymore.
 
Test it out, and it should be working perfectly. If you want to make the default state of VKey``Bd to open up with 9 octaves, go to ''File > Save Config'' and now you do not need to specify the --octave parameter anymore.

2010年5月19日 (三) 22:45的最新版本

Virtual Keyboard (aka VKey``Bd) has a very restricted set of keymappings by default. You can change this easily by editing the ~/.vkeybdmap file. The way it works is that it lists each keysym of the keyboard along with the corresponding note number to map to this key. You can figure out the keysym of any given key by installing and running the xkeycaps application:

 sudo apt-get install xkeycaps
 xkeycaps

Here is a sample of a fully-configured virtual keyboard, spanning over 3 octaves range:

global keymap
set keymap {
  {a 8}
  {z 9}
  {s 10}
  {x 11}
  {c 12}
  {f 13}
  {v 14}
  {g 15}
  {b 16}
  {n 17}
  {j 18}
  {m 19}
  {k 20}
  {comma 21}
  {l 22}
  {period 23}
  {slash 24}
  {apostrophe 25}
  {Shift_R 26}
  {Return 27}
  {Tab 24}
  {1 25}
  {q 26}
  {2 27}
  {w 28}
  {e 29}
  {4 30}
  {r 31}
  {5 32}
  {t 33}
  {6 34}
  {y 35}
  {u 36}
  {8 37}
  {i 38}
  {9 39}
  {o 40}
  {p 41}
  {minus 42}
  {bracketleft 43}
  {equal 44}
  {bracketright 45}
  {BackSpace 46}
  {backslash 47}
}

Download this file: attachment:vkeybdmap and save it as ~/.vkeybdmap This mapping may not be perfect for your needs, but it should serve as a good starting point for you. Once you have mapped all the keys how you want, be sure to start VKey``Bd with the maximum number of octaves, or else you will get weird errors when pressing keys that are not shown on screen:

 vkeybd --octave 9

Test it out, and it should be working perfectly. If you want to make the default state of VKey``Bd to open up with 9 octaves, go to File > Save Config and now you do not need to specify the --octave parameter anymore. That's all there is to it.