memo.xight.org

日々のメモ

KeyRemap4MacBook の Use Option_R as KANA/EISUU (toggle) の代替

Summary

KeyRemap4MacBook が8.0.0になってから、Use Option_R as KANA/EISUU (toggle)が動作しなくなった。
自前のXMLファイルで対応する。

Input source が com.google.inputmethod.Japanese.Roman のときは JIS_EISUU を出力
Input source が com.google.inputmethod.Japanese.base のときは JIS_KANA を出力

option-r.xml

<?xml version="1.0"?>
<root>
	<inputsourcedef>
		<name>GOOGLE_IME_JAPANESE_BASE</name>
		<inputsourceid_prefix>com.google.inputmethod.Japanese.base</inputsourceid_prefix>
	</inputsourcedef>

	<inputsourcedef>
		<name>GOOGLE_IME_JAPANESE_ROMAN</name>
		<inputsourceid_prefix>com.google.inputmethod.Japanese.Roman</inputsourceid_prefix>
	</inputsourcedef>

	<item>
		<name>Use Option_R as KANA/EISUU (toggle)</name>
		<item>
			<name>Use Option_R as KANA (only Japanese.Roman)</name>
			<inputsource_only>GOOGLE_IME_JAPANESE_ROMAN</inputsource_only>
			<identifier>private.remap.jis_unify_kana_eisuu_to_optionR_kana</identifier>
			<autogen>
				__KeyToKey__
				KeyCode::OPTION_R,
				KeyCode::JIS_KANA
			</autogen>
		</item>

		<item>
			<name>Use Option_R as EISUU (only Japanese.base)</name>
			<inputsource_only>GOOGLE_IME_JAPANESE_BASE</inputsource_only>
			<identifier>private.remap.jis_unify_kana_eisuu_to_optionR_eisuu</identifier>
			<autogen>
				__KeyToKey__
				KeyCode::OPTION_R,
				KeyCode::JIS_EISUU
			</autogen>
		</item>
	</item>
</root>

KeyRemap4MacBook を利用して Google日本語入力の変換ショートカットキーを使う

Summary

Google日本語入力のキー設定で Command が利用できない。
MS-IMEのキーバインドで変換したい。

Command+i 全角カタカナに変換
Command+t 半角英数に変換
Command+u ひらがなに変換
Command+o 半角に変換
Command+p 全角英数に変換

Google Chrome の Command+Shift+T (閉じたタブを再度開く) との衝突を回避
Command+p は使わない上、印刷のショートカットと重複するのでコメントアウト

google-ime.xml

<?xml version="1.0"?>
<root>
	<inputsourcedef>
		<name>GOOGLE_IME_JAPANESE_BASE</name>
		<inputsourceid_prefix>com.google.inputmethod.Japanese.base</inputsourceid_prefix>
	</inputsourcedef>

	<item>
		<name>Private (Google IME)</name>
		<item>
			<name>変換ショートカットキーの一部をCommandキーで有効に (only Google IME Japanese base)</name>
			<identifier>private.command_l_to_control_l_only_googleime</identifier>
			<inputsource_only>GOOGLE_IME_JAPANESE_BASE</inputsource_only>
			<!-- Google Chrome の Command + Shift + T との衝突を回避 -->
			<autogen>
				__KeyToKey__
				KeyCode::T, ModifierFlag::COMMAND_L | ModifierFlag::NONE,
				KeyCode::T, ModifierFlag::CONTROL_L,
			</autogen>
			<autogen>
				__KeyToKey__
				KeyCode::U, ModifierFlag::COMMAND_L,
				KeyCode::U, ModifierFlag::CONTROL_L,
			</autogen>
			<autogen>
				__KeyToKey__
				KeyCode::I, ModifierFlag::COMMAND_L,
				KeyCode::I, ModifierFlag::CONTROL_L,
			</autogen>
			<autogen>
				__KeyToKey__
				KeyCode::O, ModifierFlag::COMMAND_L,
				KeyCode::O, ModifierFlag::CONTROL_L,
			</autogen>
			<!-- Command + P (Print) と重複するので削除 -->
			<!--
			<autogen>
				__KeyToKey__
				KeyCode::P, ModifierFlag::COMMAND_L,
				KeyCode::P, ModifierFlag::CONTROL_L,
			</autogen>
			-->
		</item>
	</item>
</root>