Skip to content

Commit

Permalink
remove unused EditBack preserved key
Browse files Browse the repository at this point in the history
dinhngtu committed Oct 29, 2022
1 parent 9b6d804 commit d8bebad
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions VietTypeATL/KeyEventSink.cpp
Original file line number Diff line number Diff line change
@@ -27,11 +27,6 @@ static const GUID GUID_KeyEventSink_PreservedKey_Toggle = {
0x8cc27cf8, 0x93d2, 0x416c, {0xb1, 0xa3, 0x66, 0x82, 0x7f, 0x54, 0x24, 0x4a}};
static const TF_PRESERVEDKEY PK_Toggle = {VK_OEM_3, TF_MOD_ALT}; // Alt-`

// {FAC88DBE-E799-474B-9A8C-1449CAA38348}
static const GUID GUID_KeyEventSink_PreservedKey_EditBack = {
0xfac88dbe, 0xe799, 0x474b, {0x9a, 0x8c, 0x14, 0x49, 0xca, 0xa3, 0x83, 0x48}};
static const TF_PRESERVEDKEY PK_EditBack = {VK_BACK, TF_MOD_ALT};

STDMETHODIMP KeyEventSink::OnSetFocus(_In_ BOOL fForeground) {
HRESULT hr;

@@ -205,12 +200,6 @@ STDMETHODIMP KeyEventSink::OnPreservedKey(_In_ ITfContext* pic, _In_ REFGUID rgu
DBG_HRESULT_CHECK(hr, L"%s", L"_compositionManager->EndComposition failed");
hr = _controller->ToggleUserEnabled();
DBG_HRESULT_CHECK(hr, L"%s", L"_engine->ToggleEnabled failed");

} else if (GUID_KeyEventSink_PreservedKey_EditBack == rguid) {
*pfEaten = TRUE;
hr = CompositionManager::RequestEditSession(
EditSessions::EditSurroundingWord, _compositionManager, pic, _controller.p, 0);
HRESULT_CHECK_RETURN(hr, L"%s", L"CompositionManager::RequestEditSession failed");
} else {
*pfEaten = FALSE;
}
@@ -241,18 +230,12 @@ _Check_return_ HRESULT KeyEventSink::Initialize(
// probably not fatal
DBG_HRESULT_CHECK(hr, L"%s", L"_keystrokeMgr->PreserveKey failed");

hr = _keystrokeMgr->PreserveKey(_clientid, GUID_KeyEventSink_PreservedKey_EditBack, &PK_EditBack, NULL, 0);
DBG_HRESULT_CHECK(hr, L"%s", L"_keystrokeMgr->PreserveKey failed");

return S_OK;
}

HRESULT KeyEventSink::Uninitialize() {
HRESULT hr;

hr = _keystrokeMgr->UnpreserveKey(GUID_KeyEventSink_PreservedKey_EditBack, &PK_EditBack);
DBG_HRESULT_CHECK(hr, L"%s", L"_keystrokeMgr->UnpreserveKey failed");

hr = _keystrokeMgr->UnpreserveKey(GUID_KeyEventSink_PreservedKey_Toggle, &PK_Toggle);
DBG_HRESULT_CHECK(hr, L"%s", L"_keystrokeMgr->UnpreserveKey failed");

0 comments on commit d8bebad

Please sign in to comment.