| |
---|
| | iconvert.convert(k.leftShift,_nicolaTable[i].leftShift); |
---|
| | iconvert.convert(k.rightShift,_nicolaTable[i].rightShift); |
---|
| | keymap.insert(pair<KeyEvent,NicolaKey>(_nicolaTable[i].key,k)); |
---|
| | } |
---|
| | iconvert.convert(vsc,String("゛")); |
---|
| | iconvert.convert(svsc,String("゜")); |
---|
| | iconvert.convert(vs1,String("かきくけこさしすせそたちつてとはひふへほぱぴぷぺぽ")); |
---|
| | iconvert.convert(vs2,String("がぎぐげござじずぜぞだぢづでどばびぶべぼばびぶべぼ")); |
---|
| | iconvert.convert(svs1,String("はひふへほばびぶべぼ")); |
---|
| | iconvert.convert(svs2,String("ぱぴぷぺぽぱぴぷぺぽ")); |
---|
| | } |
---|
| | |
---|
| | |
---|
| | NicolaInput::~NicolaInput() |
---|
| |
---|
| | (key.code == SCIM_KEY_Hyper_L) || |
---|
| | (key.code == SCIM_KEY_Hyper_R)) return true; |
---|
| | |
---|
| | map<KeyEvent,NicolaKey>::iterator it = keymap.find(key.code); |
---|
| | if (it == keymap.end()) return true; |
---|
| | if (it == keymap.end()) { |
---|
| | if (isprint(key.get_ascii_code())) { |
---|
| | String s; |
---|
| | s += key.get_ascii_code(); |
---|
| | text = text.substr(0,pos) + utf8_mbstowcs(s) + text.substr(pos); |
---|
| | pos ++; |
---|
| | } |
---|
| | return true; |
---|
| | } |
---|
| | WideString w; |
---|
| | if (LShift) w = it->second.leftShift; |
---|
| | else if (RShift) w = it->second.rightShift; |
---|
| | else w = it->second.noShift; |
---|
| | if (w == vsc) { |
---|
| | for(unsigned int i = 0;i < vs1.length();i ++) { |
---|
| | if (vs1[i] == text[pos - 1]) text = text.substr(0,pos - 1) + vs2[i] + text.substr(pos); |
---|
| | } |
---|
| | } else |
---|
| | if (w == svsc) { |
---|
| | for(unsigned int i = 0;i < svs1.length();i ++) { |
---|
| | if (svs1[i] == text[pos - 1]) text = text.substr(0,pos - 1) + svs2[i] + text.substr(pos); |
---|
| | } |
---|
| | } else |
---|
| | if (w.length()) { |
---|
| | text = text.substr(0,pos) + w + text.substr(pos); |
---|
| | pos ++; |
---|
| | } |
---|
| |
---|
| | |