You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to my code the hotkey CTRL + J should be supressed.
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
125.0.2535.92
SDK Version
2535.41
Framework
Win32
Operating System
Windows 11
OS Version
10.0.22631
Repro steps
voidCWebBrowser::AddAcceleratorKeyPressedHandler()
{
if (m_pImpl->m_webController != nullptr)
{
CHECK_FAILURE(m_pImpl->m_webController->add_AcceleratorKeyPressed(
Callback<ICoreWebView2AcceleratorKeyPressedEventHandler>(
[this](
ICoreWebView2Controller* sender,
ICoreWebView2AcceleratorKeyPressedEventArgs* args) -> HRESULT {
COREWEBVIEW2_KEY_EVENT_KIND kind;
CHECK_FAILURE(args->get_KeyEventKind(&kind));
// We only care about key down events.if (kind == COREWEBVIEW2_KEY_EVENT_KIND_KEY_DOWN ||
kind == COREWEBVIEW2_KEY_EVENT_KIND_SYSTEM_KEY_DOWN)
{
UINT key;
CHECK_FAILURE(args->get_VirtualKey(&key));
// Check if the key is one we want to handle.bool bDetected = false;
std::function<void()> action = GetAcceleratorKeyFunction(key, bDetected);
if (action)
{
// Keep the browser from handling this key, whether it's autorepeated or// not.CHECK_FAILURE(args->put_Handled(TRUE));
// Filter out autorepeated keys.
COREWEBVIEW2_PHYSICAL_KEY_STATUS status;
CHECK_FAILURE(args->get_PhysicalKeyStatus(&status));
if (!status.WasKeyDown)
{
// Perform the action asynchronously to avoid blocking the// browser process's event queue.RunAsync(action);
}
}
if (bDetected && action == nullptr)
{
// Keep the browser from handling this key, whether it's autorepeated or// not.CHECK_FAILURE(args->put_Handled(TRUE));
}
}
return S_OK;
})
.Get(),
&m_acceleratorKeyPressedToken));
}
}
std::function<void()> CWebBrowser::GetAcceleratorKeyFunction(UINT key, bool &rbDetected)
{
// No function keysif (!IsCTRLpressed() && !IsSHIFTpressed() && !IsALTpressed())
{
switch (key)
{
case VK_F1:
rbDetected = true;
return [this] { GetParentWindow()->SendMessage(WM_COMMAND, ID_HELP_HELP, NULL); };
case VK_F5:
rbDetected = true;
return [this] { GetParentWindow()->SendMessage(WM_COMMAND, ID_VIEW_REFRESH, NULL); };
case VK_F6:
rbDetected = true;
if (GetEditorType() == EditorType::MeetingEditor)
return [this] { GetParentWindow()->SendMessage(WM_COMMAND, ID_FILE_DOWNLOAD_SCHEDULE_INFORMATION, NULL); };
break;
case VK_F7:
rbDetected = true;
if (GetEditorType() == EditorType::MeetingEditor)
return [this] { GetParentWindow()->SendMessage(WM_COMMAND, ID_MWB_DATA_EXPORT, NULL); };
break;
default:
returnnullptr;
}
}
// CTRL + SHIFT function keyselseif (IsCTRLpressed() && IsSHIFTpressed() && !IsALTpressed())
{
switch (key)
{
case_TINT(L'D'):
rbDetected = true;
if (GetEditorType() == EditorType::MeetingEditor)
return [this] { GetParentWindow()->SendMessage(WM_COMMAND, ID_EDIT_DUTY_ASSIGNMENTS, NULL); };
break;
case_TINT(L'I'):
rbDetected = true;
if (GetEditorType() == EditorType::MeetingEditor)
return [this] { GetParentWindow()->SendMessage(WM_COMMAND, ID_MWT_TRANSFER_FROM_PC, NULL); };
break;
case_TINT(L'O'):
rbDetected = true;
if (GetEditorType() == EditorType::AssignmentEditor)
return [this] { GetParentWindow()->SendMessage(WM_COMMAND, ID_OPTIONS_COLUMNS, NULL); };
break;
case_TINT(L'T'):
rbDetected = true;
if (GetEditorType() == EditorType::MeetingEditor)
return [this] { GetParentWindow()->SendMessage(WM_COMMAND, ID_EDIT_MEETING_TIMES, NULL); };
break;
default:
returnnullptr;
}
}
// CTRL function keyelseif (IsCTRLpressed() && !IsSHIFTpressed() && !IsALTpressed())
{
switch (key)
{
case_TINT(L'P'):
rbDetected = true;
return [this] { GetParentWindow()->SendMessage(WM_COMMAND, ID_FILE_PRINT_PREVIEW, NULL); };
case_TINT(L'S'):
rbDetected = true;
return [this] { GetParentWindow()->SendMessage(WM_COMMAND, ID_FILE_SAVE, NULL); };
default:
returnnullptr;
}
}
returnnullptr;
}
According to my code logic, CTRL + J should end up in the final else clause and as a result return the default, which is nullptr. So the parent code should suppress that action. Yet, I see a Download window come up on the display.
Side: point:
In your template for submitting as bug you have a typo:
Does this issue reporduce in the Edge or Chrome browsers?
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
Don't know
Last working version (if regression)
No response
The text was updated successfully, but these errors were encountered:
What happened?
According to my code the hotkey CTRL + J should be supressed.
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
125.0.2535.92
SDK Version
2535.41
Framework
Win32
Operating System
Windows 11
OS Version
10.0.22631
Repro steps
According to my code logic, CTRL + J should end up in the final else clause and as a result return the default, which is
nullptr
. So the parent code should suppress that action. Yet, I see a Download window come up on the display.Side: point:
In your template for submitting as bug you have a typo:
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
Don't know
Last working version (if regression)
No response
The text was updated successfully, but these errors were encountered: