个人工具

UbuntuHelp:HowToVirtualKeyboardKeymapping

来自Ubuntu中文

跳转至: 导航, 搜索

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.