|
Quick Links
Calendar
Categories
Total entries ()
Archives
XML/RSS Feed
Statistics
Total entries in this blog:
Total entries in this category: Published On: 2008.07.27 13:48 |
今度はFirefoxでEmacsキーバインドに挑戦前回は
ThunderbirdでEmacsキーバインドを実現できたが、Firefoxでもやれないかなこれ?…という安易な気持ちで始めたのはいいけれど…。お試しするならYour
Own Riskにて。
まずこの方法はCtrlキーにキー割当がないMacOS
X版Firefoxでしか気軽に試せない。この辺りはCmdキーがあるMacintoshの利点でもある。WindowsやLinux版ではCtrlキーへの機能定義を殺さないとEmacsキーバインドは実現できない。
Thunderbird for MacOS XではuserHTMLBindings.xmlというキー定義ファイルを作って本体のパッケージ内に置けばよかったので、Firefoxでも同じ方法を試みた。 FirefoxでEmacsキーバインドを使いたい場面はFormやURLの入力時。ようするにSafariと同じように動作して欲しい。…のだが、うまく行かない。たぶんbinding idのinputFields, editor, textAreaのユーザ定義を追加すればいいのだと思うが、userHTMLBindings.xmlを作ってもうまく動かない。 へたれの私はplatformHTMLBindings.xmlに直接定義を追加する安易な道に走ってしまった。キーは重複しないので、バックアップさえ取っておけば大丈夫。inputFields, editor, textAreaの各idに、次の定義を追加した。 <handler event="keypress" key="b" modifiers="control" command="cmd_charPrevious"/> <handler event="keypress" key="f" modifiers="control" command="cmd_charNext"/> <handler event="keypress" key="p" modifiers="control" command="cmd_linePrevious"/> <handler event="keypress" key="n" modifiers="control" command="cmd_lineNext"/> <handler event="keypress" key="a" modifiers="control" command="cmd_beginLine"/> <handler event="keypress" key="e" modifiers="control" command="cmd_endLine"/> <handler event="keypress" key="d" modifiers="control" command="cmd_deleteCharForward"/> <handler event="keypress" key="h" modifiers="control" command="cmd_deleteCharBackward"/> これでEmacsキーバインドを実現でき、一見Safariのように入力が出来る。特にWebmailではなかなか快適なのだなこれが。しかしFirefoxをバージョンアップする度に定義ファイルを書き直さないといけないんだなぁ。 |