boolean PostInputProcessAutoEng(void* arg, FcitxKeySym sym, unsigned int state, INPUT_RETURN_VALUE* retval) { FcitxAutoEngState* autoEngState = (FcitxAutoEngState*) arg; FcitxInputState* input = FcitxInstanceGetInputState(autoEngState->owner); //boolean disableCheckUAZ = FcitxInstanceGetContextBoolean(autoEngState->owner, CONTEXT_DISABLE_AUTOENG); //if (disableCheckUAZ) // return false; if (autoEngState->enable == false) return false; FcitxIM *im = FcitxInstanceGetCurrentIM(autoEngState->owner); if (im == NULL || strcmp("sogoupinyin", im->uniqueName) != 0) return false; if (FcitxHotkeyIsHotKeyUAZ(sym, state) && (FcitxInputStateGetRawInputBufferSize(input) != 0 || (FcitxInputStateGetKeyState(input) & FcitxKeyState_CapsLock) == 0) && AutoEngCheckPreedit(autoEngState)) { AutoEngSetBuff(autoEngState, FcitxInputStateGetRawInputBuffer(input), FcitxHotkeyPadToMain(sym)); AutoEngActivate(autoEngState, input, retval); return true; } return false; }
INPUT_RETURN_VALUE FcitxKkcDoInput(void* arg, FcitxKeySym _sym, unsigned int _state) { FcitxKkc *kkc = (FcitxKkc*)arg; FcitxInputState* input = FcitxInstanceGetInputState(kkc->owner); FcitxKeySym sym = (FcitxKeySym) FcitxInputStateGetKeySym(input); uint32_t state = FcitxInputStateGetKeyState(input); return FcitxKkcDoInputReal(arg, sym, state); }
INPUT_RETURN_VALUE FcitxRimeDoInput(void* arg, FcitxKeySym _sym, unsigned int _state) { FcitxRime *rime = (FcitxRime *)arg; FcitxInputState *input = FcitxInstanceGetInputState(rime->owner); uint32_t sym = FcitxInputStateGetKeySym(input); uint32_t state = FcitxInputStateGetKeyState(input); _state &= (FcitxKeyState_SimpleMask | FcitxKeyState_CapsLock); if (_state & (~(FcitxKeyState_Ctrl_Alt_Shift | FcitxKeyState_CapsLock))) { return IRV_TO_PROCESS; } state &= (FcitxKeyState_SimpleMask | FcitxKeyState_CapsLock); return FcitxRimeDoInputReal(arg, sym, state); }
boolean PostInputProcessAutoEng(void* arg, FcitxKeySym sym, unsigned int state, INPUT_RETURN_VALUE* retval) { FcitxAutoEngState* autoEngState = (FcitxAutoEngState*) arg; FcitxInputState* input = FcitxInstanceGetInputState(autoEngState->owner); boolean disableCheckUAZ = FcitxInstanceGetContextBoolean(autoEngState->owner, CONTEXT_DISABLE_AUTOENG); if (disableCheckUAZ) return false; if (FcitxHotkeyIsHotKeyUAZ(sym, state) && (FcitxInputStateGetRawInputBufferSize(input) != 0 || (FcitxInputStateGetKeyState(input) & FcitxKeyState_CapsLock) == 0) && AutoEngCheckPreedit(autoEngState)) { *retval = IRV_DISPLAY_MESSAGE; FcitxInputStateSetShowCursor(input, false); AutoEngSetBuff(autoEngState, FcitxInputStateGetRawInputBuffer(input), FcitxHotkeyPadToMain(sym)); autoEngState->active = true; ShowAutoEngMessage(autoEngState, retval); return true; } return false; }
INPUT_RETURN_VALUE FcitxUnikeyDoInput(void* arg, FcitxKeySym sym, unsigned int state) { FcitxUnikey* unikey = (FcitxUnikey*) arg; INPUT_RETURN_VALUE tmp; FcitxInputState* input = FcitxInstanceGetInputState(unikey->owner); /* use origin sym and state here */ sym = (FcitxKeySym) FcitxInputStateGetKeySym(input); state = FcitxInputStateGetKeyState(input); tmp = FcitxUnikeyDoInputPreedit(unikey, sym, state); // check last keyevent with shift if (sym >= FcitxKey_space && sym <=FcitxKey_asciitilde) { unikey->last_key_with_shift = state & FcitxKeyState_Shift; } else { unikey->last_key_with_shift = false; } // end check last keyevent with shift return tmp; }