珈琲焙煎者の観察

地下部屋の珈琲焙煎者

Schism Tracker on PocketC.H.I.P. 003

2.PocketC.H.I.P. でキーボードのSchism Trackerショートカットが効かない

について

Hook functions

Schism Tracker can run custom scripts on startup, exit, and upon completion of the disk writer. These are stored in the configuration directory, and are named startup-hook, exit-hook, and diskwriter-hook respectively. (On Windows, append .bat to the filenames.) Hooks are useful for making various adjustments to the system – adjusting the system volume, remapping the keyboard, etc. The disk writer hook can be used to do additional post-processing, converting, etc. (Note: on the Wii, hooks are not processed since there is no underlying OS or command interpreter to run them.)     

Example For users with non-US keyboards, some keys may not work properly. This can be worked around by switching temporarily to a US keyboard layout on startup, and resetting the keyboard on exit. To define hooks to accomplish this:    

cat >~/.schism/startup-hook <<EOF
#!/bin/sh
setxkbmap us
EOF
cat >~/.schism/exit-hook <<EOF
#!/bin/sh
setxkbmap fi
EOF
chmod +x ~/.schism/*-hook

This is for a Finnish keyboard; replace the fiwith the appropriate ISO 3166 country code or other keyboard mapping. See /etc/X11/xkb/symbols for a list of available keyboard layouts.

shismtrackerの起動でフックして、US配列のキーボードとして変更して、終了でもとに戻すということらしい。 pocketCHIPのデフォルトのキーボードについてコマンドで調べてみる。

chip@chip:~$ localectl
   System Locale: n/a

       VC Keymap: n/a
      X11 Layout: us
       X11 Model: pc105
chip@chip:~$ localectl list-keymaps
Couldn't find any console keymaps.

もともとUSキー配列のよう。

でも、アンダーバー"_"が入力できないことで、ファンクションキーなどもデフォルトでアサインされていない可能性に気がついた。

だから、当然ながら、schismtrackerのファンクションキーのショートカットが効かない。

pocketCHIPのユーザーコミュニティにファンクションキーについてのHow toがあった。

www.chip-community.org

Enabling the FN Keys


You will need to edit a couple of text files. I'll assume that if you want to run in text mode, you already know how to use vi, emacs, or nano.

The tool you need is "loadkeys," which is part of the "kbd" package, which is not installed by default. So start by installing it:
"kbd"というパッケージをインストールして、

sudo apt-get install kbd

Next, you need a text file that specifies the mappings, i.e. which keystrokes should produce what characters. Create a file containing the following text and save it somewhere convenient.

ファイルをつくって、なかに以下のテキストを書き込む、

keymaps 0-2,4-5,8,12
altgr keycode  2 = F1
altgr keycode  3 = F2
altgr keycode  4 = F3
altgr keycode  5 = F4
altgr keycode  6 = F5
altgr keycode  7 = F6
altgr keycode  8 = F7
altgr keycode  9 = F8
altgr keycode 10 = F9
altgr keycode 11 = F10
altgr keycode 74 = F11
shift keycode 74 = underscore
altgr keycode 13 = F12
altgr keycode 21 = braceleft
altgr keycode 22 = braceright
altgr keycode 23 = bracketleft
altgr keycode 24 = bracketright
altgr keycode 25 = bar
altgr keycode 35 = less
altgr keycode 36 = greater
altgr keycode 37 = apostrophe
altgr keycode 38 = quotedbl
altgr keycode 48 = grave
altgr keycode 49 = asciitilde
altgr keycode 50 = colon
altgr keycode 52 = semicolon
shift keycode 52 = comma
altgr keycode 53 = backslash 

ファイルの作り方は、

touch enableFNkeys
nano enableFNkeys

上のテキストをコピーしてペースト。

Test your file: テストしてみる:

sudo loadkeys /path/to/file

If you've done everything right, your FN keys should now be working. If not and the keyboard is fouled up to the point where you can't type well enough to try again, simply reboot to restore the original, no-FN mappings.

If it does work, you can make the new mapping permanent with a quick edit to your /etc/rc.local file. (Note that that's a system file; use sudo or you won't be able to save your change.

Find the line that reads

exit 0

Immediately above that line, add

#Load keymap for PocketChip keyboard
/usr/bin/loadkeys /path/to/file
Navigation menu