Masatake YAMATO
jet****@gyve*****
2005年 11月 7日 (月) 02:06:59 JST
大和と申します。 scim-skkを使い始めました。便利に使わせて頂いています。 一箇所だけどうしても使っていて気になるところがあったので、変更案とともに報告 致します。どうか変更をご検討下さい。 ascii-modeにてひらがなモードに戻るキーストロークについて、現状では Returnが割当てられています。そのためascii-modeで改行を直接挿入する方法 がないようです。Emacs上で動作するskkでは、Control+jがひらがなモードに戻 るキーストロークに割当てられており、Returnと分離しています。 Emacs上で動作するskkの操作方法に慣れているので、次のように操作したいと 思いました。 - ascii-modeにて SCIM_SKK_CONFIG_HIRAGANA_KEY を押すと ひらがなモードに戻る。 - ascii-modeにて SCIM_SKK_CONFIG_KAKUTEI_KEY を押すと 改行を挿入する。 よろしくお願いします。 2005-11-07 Masatake YAMATO <jet****@gyve*****> * src/scim_skk_core.cpp (SKKCore::action_kakutei): Just return false if in ascii mode. Don't call clear_pending. Don't switch to hiragana mode. (SKKCore::action_hiragana): New method implementation for switching to hiragana mode. (SKKCore::process_remaining_keybinds): Add match_hiragana_keys() invocation. * src/scim_skk_core.h (class SKKCore::action_hiragana): New method declaration. * src/scim_skk_imengine.cpp (reload_config): read configuration entry for hiragana. * src/scim_skk_imengine_setup.cpp (__config_keyboards_mode): Add a key for hiragana. * src/scim_skk_keybind.cpp (KeyBind::set_hiragana_keys): New method implementation. (KeyBind::match_hiragana_keys): Ditto. * src/scim_skk_keybind.h (KeyBind::m_hiragana_keys): New member. (KeyBind::set_hiragana_keys): New method declaration. (KeyBind::match_hiragana_keys): Ditto. * src/scim_skk_prefs.h (SCIM_SKK_CONFIG_HIRAGANA_KEY): New definition. (SCIM_SKK_CONFIG_KAKUTEI_KEY_DEFAULT): Use "Return" as default value. (SCIM_SKK_CONFIG_HIRAGANA_KEY_DEFAULT): New definition. Index: src/scim_skk_prefs.h =================================================================== RCS file: /cvsroot/scim-imengine/scim-skk/src/scim_skk_prefs.h,v retrieving revision 1.15 diff -u -r1.15 scim_skk_prefs.h --- src/scim_skk_prefs.h 29 Jun 2005 05:31:26 -0000 1.15 +++ src/scim_skk_prefs.h 6 Nov 2005 16:43:51 -0000 @@ -23,6 +23,7 @@ #define SCIM_SKK_CONFIG_KAKUTEI_KEY "/IMEngine/SKK/Kakutei" #define SCIM_SKK_CONFIG_KATAKANA_KEY "/IMEngine/SKK/Katakana" #define SCIM_SKK_CONFIG_HALF_KATAKANA_KEY "/IMEngine/SKK/HalfKatakana" +#define SCIM_SKK_CONFIG_HIRAGANA_KEY "/IMEngine/SKK/Hiragana" #define SCIM_SKK_CONFIG_ASCII_KEY "/IMEngine/SKK/ASCII" #define SCIM_SKK_CONFIG_WIDE_ASCII_KEY "/IMEngine/SKK/WideASCII" #define SCIM_SKK_CONFIG_CONVERT_KEY "/IMEngine/SKK/Convert" @@ -54,9 +55,10 @@ #define SCIM_SKK_CONFIG_IGNORE_RETURN "/IMEngine/SKK/IgnoreReturn" /* default values */ -#define SCIM_SKK_CONFIG_KAKUTEI_KEY_DEFAULT "Control+j" +#define SCIM_SKK_CONFIG_KAKUTEI_KEY_DEFAULT "Return" #define SCIM_SKK_CONFIG_KATAKANA_KEY_DEFAULT "q" #define SCIM_SKK_CONFIG_HALF_KATAKANA_KEY_DEFAULT "" +#define SCIM_SKK_CONFIG_HIRAGANA_KEY_DEFAULT "Control+j" #define SCIM_SKK_CONFIG_ASCII_KEY_DEFAULT "l" #define SCIM_SKK_CONFIG_WIDE_ASCII_KEY_DEFAULT "Shift+L" #define SCIM_SKK_CONFIG_CONVERT_KEY_DEFAULT "space" Index: src/scim_skk_keybind.h =================================================================== RCS file: /cvsroot/scim-imengine/scim-skk/src/scim_skk_keybind.h,v retrieving revision 1.10 diff -u -r1.10 scim_skk_keybind.h --- src/scim_skk_keybind.h 13 Oct 2005 07:26:06 -0000 1.10 +++ src/scim_skk_keybind.h 6 Nov 2005 16:43:51 -0000 @@ -36,6 +36,7 @@ KeyEventList m_kakutei_keys; KeyEventList m_katakana_keys; KeyEventList m_half_katakana_keys; + KeyEventList m_hiragana_keys; KeyEventList m_ascii_keys; KeyEventList m_wide_ascii_keys; KeyEventList m_convert_keys; @@ -64,6 +65,7 @@ void set_kakutei_keys (const String &str); void set_katakana_keys (const String &str); void set_half_katakana_keys (const String &str); + void set_hiragana_keys (const String &str); void set_ascii_keys (const String &str); void set_wide_ascii_keys (const String &str); void set_convert_keys (const String &str); @@ -84,6 +86,7 @@ bool match_kakutei_keys (const KeyEvent &key); bool match_katakana_keys (const KeyEvent &key); bool match_half_katakana_keys (const KeyEvent &key); + bool match_hiragana_keys (const KeyEvent &key); bool match_ascii_keys (const KeyEvent &key); bool match_wide_ascii_keys (const KeyEvent &key); bool match_convert_keys (const KeyEvent &key); Index: src/scim_skk_keybind.cpp =================================================================== RCS file: /cvsroot/scim-imengine/scim-skk/src/scim_skk_keybind.cpp,v retrieving revision 1.17 diff -u -r1.17 scim_skk_keybind.cpp --- src/scim_skk_keybind.cpp 13 Oct 2005 07:26:06 -0000 1.17 +++ src/scim_skk_keybind.cpp 6 Nov 2005 16:43:51 -0000 @@ -166,6 +166,11 @@ keybind_string_to_key_list(m_half_katakana_keys, str); } void +KeyBind::set_hiragana_keys (const String &str) +{ + keybind_string_to_key_list(m_hiragana_keys, str); +} +void KeyBind::set_ascii_keys (const String &str) { keybind_string_to_key_list(m_ascii_keys, str); @@ -252,6 +257,11 @@ return match_key_event(m_half_katakana_keys, key); } bool +KeyBind::match_hiragana_keys (const KeyEvent &key) +{ + return match_key_event(m_hiragana_keys, key); +} +bool KeyBind::match_ascii_keys (const KeyEvent &key) { return match_key_event(m_ascii_keys, key); Index: src/scim_skk_imengine_setup.cpp =================================================================== RCS file: /cvsroot/scim-imengine/scim-skk/src/scim_skk_imengine_setup.cpp,v retrieving revision 1.15 diff -u -r1.15 scim_skk_imengine_setup.cpp --- src/scim_skk_imengine_setup.cpp 21 Oct 2005 08:49:09 -0000 1.15 +++ src/scim_skk_imengine_setup.cpp 6 Nov 2005 16:43:51 -0000 @@ -271,6 +271,15 @@ NULL, }, { + SCIM_SKK_CONFIG_HIRAGANA_KEY, + SCIM_SKK_CONFIG_HIRAGANA_KEY_DEFAULT, + N_("Hiraganak Keys:"), + N_("Select Hiragana Keys"), + N_("The key events to switch the skkmode from ascii to hiragana. "), + NULL, + NULL, + }, + { SCIM_SKK_CONFIG_ASCII_KEY, SCIM_SKK_CONFIG_ASCII_KEY_DEFAULT, N_("ASCII Keys:"), Index: src/scim_skk_imengine.cpp =================================================================== RCS file: /cvsroot/scim-imengine/scim-skk/src/scim_skk_imengine.cpp,v retrieving revision 1.33 diff -u -r1.33 scim_skk_imengine.cpp --- src/scim_skk_imengine.cpp 19 Oct 2005 11:16:58 -0000 1.33 +++ src/scim_skk_imengine.cpp 6 Nov 2005 16:43:51 -0000 @@ -229,6 +229,9 @@ str = config->read(String(SCIM_SKK_CONFIG_HALF_KATAKANA_KEY), String(SCIM_SKK_CONFIG_HALF_KATAKANA_KEY_DEFAULT)); m_keybind.set_half_katakana_keys(str); + str = config->read(String(SCIM_SKK_CONFIG_HIRAGANA_KEY), + String(SCIM_SKK_CONFIG_HIRAGANA_KEY_DEFAULT)); + m_keybind.set_hiragana_keys(str); str = config->read(String(SCIM_SKK_CONFIG_ASCII_KEY), String(SCIM_SKK_CONFIG_ASCII_KEY_DEFAULT)); m_keybind.set_ascii_keys(str); Index: src/scim_skk_core.h =================================================================== RCS file: /cvsroot/scim-imengine/scim-skk/src/scim_skk_core.h,v retrieving revision 1.17 diff -u -r1.17 scim_skk_core.h --- src/scim_skk_core.h 19 Oct 2005 11:16:58 -0000 1.17 +++ src/scim_skk_core.h 6 Nov 2005 16:43:51 -0000 @@ -92,6 +92,7 @@ bool action_cancel (void); bool action_convert (void); bool action_katakana (bool half = false); + bool action_hiragana (void); bool action_start_preedit (void); bool action_prevcand (void); bool action_ascii (bool wide = false); Index: src/scim_skk_core.cpp =================================================================== RCS file: /cvsroot/scim-imengine/scim-skk/src/scim_skk_core.cpp,v retrieving revision 1.39 diff -u -r1.39 scim_skk_core.cpp --- src/scim_skk_core.cpp 19 Oct 2005 11:16:58 -0000 1.39 +++ src/scim_skk_core.cpp 6 Nov 2005 16:43:51 -0000 @@ -442,7 +442,7 @@ m_end_flag = true; return false; } else { - clear_pending(); + return false; } break; case INPUT_MODE_PREEDIT: @@ -469,9 +469,6 @@ default: break; } - if(m_skk_mode == SKK_MODE_ASCII || m_skk_mode == SKK_MODE_WIDE_ASCII) { - set_skk_mode(SKK_MODE_HIRAGANA); - } return true; } @@ -595,6 +592,22 @@ } bool +SKKCore::action_hiragana(void) +{ + switch (m_input_mode) { + case INPUT_MODE_DIRECT: + if (m_skk_mode == SKK_MODE_ASCII || + m_skk_mode == SKK_MODE_WIDE_ASCII) { + clear_pending(); + set_skk_mode(SKK_MODE_HIRAGANA); + return true; + } + default: + return action_katakana(); + } +} + +bool SKKCore::action_toggle_case (void) { if (m_input_mode == INPUT_MODE_PREEDIT && m_skk_mode == SKK_MODE_ASCII) { @@ -958,6 +971,9 @@ if (m_keybind->match_half_katakana_keys(key)) return action_katakana(true); + if (m_keybind->match_hiragana_keys(key)) + return action_hiragana(); + if (m_keybind->match_start_preedit_keys(key)) return action_start_preedit(); Index: po/ja.po =================================================================== RCS file: /cvsroot/scim-imengine/scim-skk/po/ja.po,v retrieving revision 1.11 diff -u -r1.11 ja.po --- po/ja.po 21 Oct 2005 16:14:13 -0000 1.11 +++ po/ja.po 6 Nov 2005 16:43:52 -0000 @@ -6,39 +6,39 @@ msgstr "" "Project-Id-Version: scim-skk\n" "Report-Msgid-Bugs-To: mukai****@jmuk*****\n" -"POT-Creation-Date: 2005-10-21 17:46+0900\n" -"PO-Revision-Date: 2004-12-27 01:06+0900\n" +"POT-Creation-Date: 2005-11-06 02:19+0900\n" +"PO-Revision-Date: 2005-11-06 02:22+0900\n" "Last-Translator: Jun Mukai <mukai****@jmuk*****>\n" "Language-Team: Japanese <ja****@li*****>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: src/scim_skk_imengine.cpp:496 +#: src/scim_skk_imengine.cpp:499 msgid "Input mode" msgstr "入力モード" -#: src/scim_skk_imengine.cpp:500 +#: src/scim_skk_imengine.cpp:503 msgid "Hiragana" msgstr "ひらがな" -#: src/scim_skk_imengine.cpp:504 +#: src/scim_skk_imengine.cpp:507 msgid "Katakana" msgstr "カタカナ" -#: src/scim_skk_imengine.cpp:508 src/scim_skk_imengine.cpp:509 +#: src/scim_skk_imengine.cpp:511 src/scim_skk_imengine.cpp:512 msgid "Half width katakana" msgstr "半角カタカナ" -#: src/scim_skk_imengine.cpp:513 +#: src/scim_skk_imengine.cpp:516 msgid "ASCII" msgstr "英数" -#: src/scim_skk_imengine.cpp:513 +#: src/scim_skk_imengine.cpp:516 msgid "Direct input" msgstr "直接入力" -#: src/scim_skk_imengine.cpp:517 +#: src/scim_skk_imengine.cpp:520 msgid "Wide ASCII" msgstr "全角英数" @@ -160,193 +160,205 @@ msgstr "ひらがなモードと半角カタカナモードをトグルするキーイベント" #: src/scim_skk_imengine_setup.cpp:276 +msgid "Hiraganak Keys:" +msgstr "ひらがなキー" + +#: src/scim_skk_imengine_setup.cpp:277 +msgid "Select Hiragana Keys" +msgstr "ひらがなキーの設定" + +#: src/scim_skk_imengine_setup.cpp:278 +msgid "The key events to switch the skkmode from ascii to hiragana. " +msgstr "英数からひらがなへモードを切り替えるキーイベント" + +#: src/scim_skk_imengine_setup.cpp:285 msgid "ASCII Keys:" msgstr "英数キー:" -#: src/scim_skk_imengine_setup.cpp:277 +#: src/scim_skk_imengine_setup.cpp:286 msgid "Select ASCII Keys" msgstr "英数キーの設定" -#: src/scim_skk_imengine_setup.cpp:278 +#: src/scim_skk_imengine_setup.cpp:287 msgid "The key events to enter ASII mode. " msgstr "英数モードに切り替えるキーイベント" -#: src/scim_skk_imengine_setup.cpp:285 +#: src/scim_skk_imengine_setup.cpp:294 msgid "Wide-ASCII Keys:" msgstr "全角英数キー:" -#: src/scim_skk_imengine_setup.cpp:286 +#: src/scim_skk_imengine_setup.cpp:295 msgid "Select Wide-ASCII Keys" msgstr "全角英数キーの設定" -#: src/scim_skk_imengine_setup.cpp:287 +#: src/scim_skk_imengine_setup.cpp:296 msgid "The key events to enter Wide-ASCII mode. " msgstr "全角英数キーに切り替えるキーイベント" -#: src/scim_skk_imengine_setup.cpp:307 +#: src/scim_skk_imengine_setup.cpp:316 msgid "Backspace Keys:" msgstr "バックスペースキー:" -#: src/scim_skk_imengine_setup.cpp:308 +#: src/scim_skk_imengine_setup.cpp:317 msgid "Select Backspace Keys" msgstr "バックスペースキーの設定" -#: src/scim_skk_imengine_setup.cpp:309 +#: src/scim_skk_imengine_setup.cpp:318 msgid "The key events to backspace. " msgstr "キャレットの前の文字を削除するキーイベント" -#: src/scim_skk_imengine_setup.cpp:316 +#: src/scim_skk_imengine_setup.cpp:325 msgid "Delete Keys:" msgstr "削除キー:" -#: src/scim_skk_imengine_setup.cpp:317 +#: src/scim_skk_imengine_setup.cpp:326 msgid "Select Delete Keys" msgstr "削除キーの設定" -#: src/scim_skk_imengine_setup.cpp:318 +#: src/scim_skk_imengine_setup.cpp:327 msgid "The key events to delete. " msgstr "キャレットの後の文字を削除するキーイベント" -#: src/scim_skk_imengine_setup.cpp:325 +#: src/scim_skk_imengine_setup.cpp:334 msgid "Forward Keys:" msgstr "前方へ移動キー:" -#: src/scim_skk_imengine_setup.cpp:326 +#: src/scim_skk_imengine_setup.cpp:335 msgid "Select Forward Keys" msgstr "前方へ移動キーの設定" -#: src/scim_skk_imengine_setup.cpp:327 +#: src/scim_skk_imengine_setup.cpp:336 msgid "The key events to move the caret forward. " msgstr "キャレットを前方に移動するキーイベント" -#: src/scim_skk_imengine_setup.cpp:334 +#: src/scim_skk_imengine_setup.cpp:343 msgid "Backward Keys:" msgstr "後方へ移動キー:" -#: src/scim_skk_imengine_setup.cpp:335 +#: src/scim_skk_imengine_setup.cpp:344 msgid "Select Backward Keys" msgstr "後方へ移動キーの設定" -#: src/scim_skk_imengine_setup.cpp:336 +#: src/scim_skk_imengine_setup.cpp:345 msgid "The key events to move the caret backward. " msgstr "キャレットを後方に移動するキーイベント" -#: src/scim_skk_imengine_setup.cpp:343 +#: src/scim_skk_imengine_setup.cpp:352 msgid "Home Keys:" msgstr "先頭キー:" -#: src/scim_skk_imengine_setup.cpp:344 +#: src/scim_skk_imengine_setup.cpp:353 msgid "Select Home Keys" msgstr "先頭キーを選択" -#: src/scim_skk_imengine_setup.cpp:345 +#: src/scim_skk_imengine_setup.cpp:354 msgid "The key events to move the caret to the start of preedit. " msgstr "キャレットを候補文字列の先頭に移動するキーイベント" -#: src/scim_skk_imengine_setup.cpp:352 +#: src/scim_skk_imengine_setup.cpp:361 msgid "End Keys:" msgstr "終端キー:" -#: src/scim_skk_imengine_setup.cpp:353 +#: src/scim_skk_imengine_setup.cpp:362 msgid "Select End Keys" msgstr "終端キーを選択" -#: src/scim_skk_imengine_setup.cpp:354 +#: src/scim_skk_imengine_setup.cpp:363 msgid "The key events to move the caret to the end of preedit. " msgstr "キャレットを候補文字列の終端に移動するキーイベント" -#: src/scim_skk_imengine_setup.cpp:370 +#: src/scim_skk_imengine_setup.cpp:379 msgid "System Dictionary Path:" msgstr "システム辞書のパス:" -#: src/scim_skk_imengine_setup.cpp:378 +#: src/scim_skk_imengine_setup.cpp:387 msgid "qwerty arrangement" msgstr "qwerty配列" -#: src/scim_skk_imengine_setup.cpp:379 +#: src/scim_skk_imengine_setup.cpp:388 msgid "Dvorak arrangement" msgstr "Dvorak配列" -#: src/scim_skk_imengine_setup.cpp:380 +#: src/scim_skk_imengine_setup.cpp:389 msgid "number selection" msgstr "数値選択" -#: src/scim_skk_imengine_setup.cpp:386 +#: src/scim_skk_imengine_setup.cpp:395 msgid "aux window" msgstr "補助ウィンドウ" -#: src/scim_skk_imengine_setup.cpp:387 +#: src/scim_skk_imengine_setup.cpp:396 msgid "inline" msgstr "インライン" -#: src/scim_skk_imengine_setup.cpp:393 +#: src/scim_skk_imengine_setup.cpp:402 msgid "all" msgstr "全て" -#: src/scim_skk_imengine_setup.cpp:394 +#: src/scim_skk_imengine_setup.cpp:403 msgid "cursor position only" msgstr "カーソル位置のみ" -#: src/scim_skk_imengine_setup.cpp:401 +#: src/scim_skk_imengine_setup.cpp:410 msgid "Co_lor:" msgstr "色(_L)" -#: src/scim_skk_imengine_setup.cpp:402 +#: src/scim_skk_imengine_setup.cpp:411 msgid "the color of annotation text" msgstr "アノテーションの背景色" -#: src/scim_skk_imengine_setup.cpp:403 +#: src/scim_skk_imengine_setup.cpp:412 msgid "the color of annotation text in the candidate text." msgstr "候補文字列におけるアノテーションの背景色" -#: src/scim_skk_imengine_setup.cpp:409 +#: src/scim_skk_imengine_setup.cpp:418 msgid "Common keys" msgstr "一般キー" -#: src/scim_skk_imengine_setup.cpp:410 +#: src/scim_skk_imengine_setup.cpp:419 msgid "Mode keys" msgstr "モード切替キー" -#: src/scim_skk_imengine_setup.cpp:411 +#: src/scim_skk_imengine_setup.cpp:420 msgid "Caret keys" msgstr "カーソル移動キー" -#: src/scim_skk_imengine_setup.cpp:511 +#: src/scim_skk_imengine_setup.cpp:520 msgid "Selection Style:" msgstr "候補選択スタイル:" -#: src/scim_skk_imengine_setup.cpp:520 +#: src/scim_skk_imengine_setup.cpp:529 msgid "List Size:" msgstr "候補リスト長:" -#: src/scim_skk_imengine_setup.cpp:532 +#: src/scim_skk_imengine_setup.cpp:541 msgid "Ignore Return at the end of learning." msgstr "学習終了時のreturnキーを無視する" -#: src/scim_skk_imengine_setup.cpp:540 +#: src/scim_skk_imengine_setup.cpp:549 msgid "Highlight Annotation." msgstr "アノテーションの色を設定する" -#: src/scim_skk_imengine_setup.cpp:552 +#: src/scim_skk_imengine_setup.cpp:561 msgid "View Annotation." msgstr "アノテーションを見る" -#: src/scim_skk_imengine_setup.cpp:565 +#: src/scim_skk_imengine_setup.cpp:574 msgid "Position of Annotation:" msgstr "アノテーションの位置:" -#: src/scim_skk_imengine_setup.cpp:571 +#: src/scim_skk_imengine_setup.cpp:580 msgid "Printed Annotation:" msgstr "アノテーションの表示:" -#: src/scim_skk_imengine_setup.cpp:627 +#: src/scim_skk_imengine_setup.cpp:636 msgid "User Dictionary Name:" msgstr "ユーザ辞書の名前:" -#: src/scim_skk_imengine_setup.cpp:731 +#: src/scim_skk_imengine_setup.cpp:740 msgid "Options" msgstr "オプション" -#: src/scim_skk_imengine_setup.cpp:737 +#: src/scim_skk_imengine_setup.cpp:746 msgid "Dictionary" msgstr "辞書関連"