diff --git a/honoka/plugins/asciiinput.cpp b/honoka/plugins/asciiinput.cpp index ec5a0a8..7928ab0 100644 --- a/honoka/plugins/asciiinput.cpp +++ b/honoka/plugins/asciiinput.cpp @@ -20,6 +20,8 @@ #include "asciiinput.h" +#include + #ifdef HAVE_CONFIG_H #include #endif @@ -38,6 +40,7 @@ AsciiInput::AsciiInput(ConfigPointer cfg) : PreEditor(cfg) { + scim_string_to_key_list(lowProprotyKey,cfg->read(HONOKA_CONFIG_ASCIIINPUT_LOW_PRIORITY_KEY,String(HONOKA_DEFAULT_ASCIIINPUT_LOW_PRIORITY_KEY))); } @@ -75,6 +78,29 @@ */ bool AsciiInput::inputEvent(const KeyEvent &key) { + return keyEvent(key); +} + + + +/*! + \fn AsciiInput::keyEventHook(const KeyEvent &key) + */ +bool AsciiInput::keyEventHook(const KeyEvent &key) +{ + if (key.is_key_release()) return false; + if (lowProprotyKey.comp(key)) return false; + else return keyEvent(key); +} + + + + +/*! + \fn Honoka::AsciiInput::keyEvent(const KeyEvent &key) + */ +bool Honoka::AsciiInput::keyEvent(const KeyEvent &key) +{ // ���äƤ����٤���Ρ� if ((key.code == SCIM_KEY_Shift_L) || (key.code == SCIM_KEY_Shift_R) || @@ -87,17 +113,6 @@ (key.code == SCIM_KEY_Hyper_L) || (key.code == SCIM_KEY_Hyper_R)) return true; - return false; -} - - - -/*! - \fn AsciiInput::keyEventHook(const KeyEvent &key) - */ -bool AsciiInput::keyEventHook(const KeyEvent &key) -{ - if (key.is_key_release()) return false; if (isprint(key.get_ascii_code()) && (!key.is_alt_down()) && (!key.is_control_down())) { String c; c += key.get_ascii_code(); @@ -107,5 +122,3 @@ } return false; } - - diff --git a/honoka/plugins/asciiinput.h b/honoka/plugins/asciiinput.h index 58ec23d..d649324 100644 --- a/honoka/plugins/asciiinput.h +++ b/honoka/plugins/asciiinput.h @@ -47,6 +47,10 @@ virtual String getPropertyName(); virtual bool keyEventHook(const KeyEvent &key); +protected: + HonokaKeyEventList lowProprotyKey; +protected: + bool keyEvent(const KeyEvent &key); }; } #endif diff --git a/honoka/plugins/asciiplugin.cpp b/honoka/plugins/asciiplugin.cpp index ca5f4b9..b607587 100644 --- a/honoka/plugins/asciiplugin.cpp +++ b/honoka/plugins/asciiplugin.cpp @@ -49,6 +49,12 @@ _("input the path of Words file."), HONOKA_DEFAULT_WORDSPREDICTION_FILE )); + page->append(new HonokaSetupKeyItem( + _("Low priority key: "), + String(HONOKA_CONFIG_ASCIIINPUT_LOW_PRIORITY_KEY), + _("set the key that lowers priority."), + String(HONOKA_DEFAULT_ASCIIINPUT_LOW_PRIORITY_KEY) + )); HonokaSetupPage *sc = new HonokaSetupPage(_("shortcut keys: "),"",""); sc->append(new HonokaSetupKeyItem( diff --git a/honoka/plugins/asciiplugin.h b/honoka/plugins/asciiplugin.h index b9fd82b..e5e3418 100644 --- a/honoka/plugins/asciiplugin.h +++ b/honoka/plugins/asciiplugin.h @@ -35,6 +35,8 @@ #define HONOKA_CONFIG_WORDSPREDICTION_FILE "/IMEngine/Honoka/WordsPrediction/WordsFile" #define HONOKA_DEFAULT_WORDSPREDICTION_FILE "/usr/share/dict/words" +#define HONOKA_CONFIG_ASCIIINPUT_LOW_PRIORITY_KEY "/IMEngine/Honoka/AsciiInput/LowPriorityKey" +#define HONOKA_DEFAULT_ASCIIINPUT_LOW_PRIORITY_KEY "" using namespace std; using namespace scim; diff --git a/honoka/po/honoka.pot b/honoka/po/honoka.pot index 418bb13..bcc2676 100644 --- a/honoka/po/honoka.pot +++ b/honoka/po/honoka.pot @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-01-21 15:20+0900\n" +"POT-Creation-Date: 2006-01-24 23:28+0900\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -447,7 +447,7 @@ #: plugins/wnnplugin.cpp:78 plugins/anthyplugin.cpp:46 #: plugins/simpleprediction.cpp:53 plugins/primeprediction.cpp:71 #: plugins/skkdicconversion.cpp:53 plugins/cannaconversion.cpp:57 -#: plugins/asciiplugin.cpp:53 +#: plugins/asciiplugin.cpp:59 msgid "shortcut keys: " msgstr "" @@ -718,19 +718,27 @@ msgid "input the path of Words file." msgstr "" +#: plugins/asciiplugin.cpp:53 +msgid "Low priority key: " +msgstr "" + #: plugins/asciiplugin.cpp:55 -msgid "Ascii Input: " +msgid "set the key that lowers priority." msgstr "" #: plugins/asciiplugin.cpp:61 +msgid "Ascii Input: " +msgstr "" + +#: plugins/asciiplugin.cpp:67 msgid "Words Prediction: " msgstr "" -#: plugins/asciiinput.cpp:53 +#: plugins/asciiinput.cpp:56 msgid "Aa" msgstr "" -#: plugins/asciiinput.cpp:69 +#: plugins/asciiinput.cpp:72 msgid "AsciiInput" msgstr "" diff --git a/honoka/po/ja.po b/honoka/po/ja.po index df31c24..7ec40bb 100644 --- a/honoka/po/ja.po +++ b/honoka/po/ja.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: ja\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-01-21 15:20+0900\n" +"POT-Creation-Date: 2006-01-24 23:28+0900\n" "PO-Revision-Date: 2004-12-01 14:29+0900\n" "Last-Translator: TAM (Teppei Tamra) \n" "Language-Team: Japanese\n" @@ -453,7 +453,7 @@ #: plugins/wnnplugin.cpp:78 plugins/anthyplugin.cpp:46 #: plugins/simpleprediction.cpp:53 plugins/primeprediction.cpp:71 #: plugins/skkdicconversion.cpp:53 plugins/cannaconversion.cpp:57 -#: plugins/asciiplugin.cpp:53 +#: plugins/asciiplugin.cpp:59 msgid "shortcut keys: " msgstr "ショートカットキー:" @@ -726,19 +726,28 @@ msgid "input the path of Words file." msgstr "単語ファイルを指定します" +#: plugins/asciiplugin.cpp:53 +msgid "Low priority key: " +msgstr "優先度を下げるキー:" + #: plugins/asciiplugin.cpp:55 +msgid "set the key that lowers priority." +msgstr "" +"優先度を下げるキーを指定します。" + +#: plugins/asciiplugin.cpp:61 msgid "Ascii Input: " msgstr "英数字入力:" -#: plugins/asciiplugin.cpp:61 +#: plugins/asciiplugin.cpp:67 msgid "Words Prediction: " msgstr "英単語予測:" -#: plugins/asciiinput.cpp:53 +#: plugins/asciiinput.cpp:56 msgid "Aa" msgstr "[Aa]" -#: plugins/asciiinput.cpp:69 +#: plugins/asciiinput.cpp:72 msgid "AsciiInput" msgstr "英数字入力"