diff --git a/scim-wnn/src/preeditor.cpp b/scim-wnn/src/preeditor.cpp index e628ac4..dca4f68 100644 --- a/scim-wnn/src/preeditor.cpp +++ b/scim-wnn/src/preeditor.cpp @@ -31,10 +31,16 @@ } bool PreEditorKeyEventList::comp(const KeyEvent &k) { + int kc = k.get_ascii_code(); + if ((kc > 0x60) && (kc < 0x7b)) kc -= 0x20; + else if ((kc > 0x40) && (kc < 0x5b)) kc += 0x20; for (unsigned int i = 0;i < size();i ++) { if ((at(i).code == k.code) && (at(i).mask == k.mask)) { return(true); } + if (kc && (at(i).code == kc) && (at(i).mask == k.mask)) { + return(true); + } } return(false); } diff --git a/scim-wnn/src/romkan.cpp b/scim-wnn/src/romkan.cpp index 58c4aa7..b144d83 100644 --- a/scim-wnn/src/romkan.cpp +++ b/scim-wnn/src/romkan.cpp @@ -471,7 +471,7 @@ } if ((buf.length() < hookp.length()) || (!hookp.length())) return(false); - else if (buf.substr(buf.length() - hookp.length()) == hookp) { + else if (buf.substr(0,hookp.length()) == hookp) { return(inputEvent(key)); } return(false); diff --git a/scim-wnn/src/scim_wnn_imengine.cpp b/scim-wnn/src/scim_wnn_imengine.cpp index 4e8ff0b..b0d21f7 100644 --- a/scim-wnn/src/scim_wnn_imengine.cpp +++ b/scim-wnn/src/scim_wnn_imengine.cpp @@ -160,10 +160,16 @@ } bool WnnKeyEventList::comp(const KeyEvent &k) { + int kc = k.get_ascii_code(); + if ((kc > 0x60) && (kc < 0x7b)) kc -= 0x20; + else if ((kc > 0x40) && (kc < 0x5b)) kc += 0x20; for (unsigned int i = 0;i < size();i ++) { if ((at(i).code == k.code) && (at(i).mask == k.mask)) { return(true); } + if (kc && (at(i).code == kc) && (at(i).mask == k.mask)) { + return(true); + } } return(false); } @@ -430,9 +436,13 @@ bool WnnInstance::process_key_event (const KeyEvent& key) { if (key.is_key_release()) return(false); - if (m_conversion) return(process_conversion_key_event(key)); - else if (m_yosoku) return(process_yosoku_key_event(key)); - else return(process_preedit_key_event(key)); + KeyEvent ke = key; + if (ke.mask & SCIM_KEY_CapsLockMask) ke.mask -= SCIM_KEY_CapsLockMask; + if (ke.mask & SCIM_KEY_NumLockMask) ke.mask -= SCIM_KEY_NumLockMask; + if (ke.mask & SCIM_KEY_ScrollLockMask) ke.mask -= SCIM_KEY_ScrollLockMask; + if (m_conversion) return(process_conversion_key_event(ke)); + else if (m_yosoku) return(process_yosoku_key_event(ke)); + else return(process_preedit_key_event(ke)); }