void CTextService::_UninitPreservedKey() { ITfKeystrokeMgr *pKeystrokeMgr; if (_pThreadMgr->QueryInterface(IID_ITfKeystrokeMgr, (void **)&pKeystrokeMgr) != S_OK) return; pKeystrokeMgr->UnpreserveKey(GUID_PRESERVEDKEY_BURGLISH, &c_pkeyburglish); pKeystrokeMgr->UnpreserveKey(GUID_PRESERVEDKEY_BURMESE, &c_pkeyburmese); pKeystrokeMgr->Release(); }
void CTextService::_UninitPreservedKey() { ITfKeystrokeMgr *pKeystrokeMgr; if (_pThreadMgr->QueryInterface(IID_ITfKeystrokeMgr, (void **)&pKeystrokeMgr) != S_OK) return; pKeystrokeMgr->UnpreserveKey(GUID_PRESERVEDKEY_ONOFF, &c_pkeyOnOff0); pKeystrokeMgr->UnpreserveKey(GUID_PRESERVEDKEY_ONOFF, &c_pkeyOnOff1); pKeystrokeMgr->UnpreserveKey(GUID_PRESERVEDKEY_F6, &c_pkeyF6); pKeystrokeMgr->Release(); }
void CTextService::_UninitPreservedKey(int onoff) { HRESULT hr; if(onoff != 0 && onoff != 1) { return; } ITfKeystrokeMgr *pKeystrokeMgr; if(_pThreadMgr->QueryInterface(IID_PPV_ARGS(&pKeystrokeMgr)) == S_OK) { for(int i = 0; i < MAX_PRESERVEDKEY; i++) { if(preservedkey[onoff][i].uVKey == 0 && preservedkey[onoff][i].uModifiers == 0) { break; } hr = pKeystrokeMgr->UnpreserveKey(c_guidPreservedKeyOnOff[onoff], &preservedkey[onoff][i]); } SafeRelease(&pKeystrokeMgr); } }
void CTextService::_UninitPreservedKey() { ITfKeystrokeMgr *pKeystrokeMgr; if(_pThreadMgr->QueryInterface(IID_PPV_ARGS(&pKeystrokeMgr)) == S_OK) { for(int i = 0; i < MAX_PRESERVEDKEY; i++) { if(preservedkey[i].uVKey == 0 && preservedkey[i].uModifiers == 0) { break; } pKeystrokeMgr->UnpreserveKey(c_guidPreservedKeyOnOff, &preservedkey[i]); } SafeRelease(&pKeystrokeMgr); } }
void TextService::removePreservedKey(const GUID& guid) { vector<PreservedKey>::iterator it; for(it = preservedKeys_.begin(); it != preservedKeys_.end(); ++it) { PreservedKey& preservedKey = *it; if(::IsEqualIID(preservedKey.guid, guid)) { if(threadMgr_) { // our text service is activated ITfKeystrokeMgr *keystrokeMgr; if (threadMgr_->QueryInterface(IID_ITfKeystrokeMgr, (void **)&keystrokeMgr) == S_OK) { keystrokeMgr->UnpreserveKey(preservedKey.guid, &preservedKey); keystrokeMgr->Release(); } } preservedKeys_.erase(it); break; } } }