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
{{ message }}
Repository navigation
[Feature]: add a setting to CoreWebView2Settings to enable Ctrl+F find #4639
I want to enable the Ctrl+F find popup without enabling all other accelerator keys. Currently, it seems like I have to set AreBrowserAcceleratorKeysEnabled to get Ctrl+F to work.
The scenario/use case where you would use this feature
Don't want other keys to get handled.
Ideally, we could intercept those keys and handle them to get, for example Ctrl+R to not refresh the page, but sometimes our webapp might want to handle the event and setting e.Handled = true prevents the page from getting the event.
How important is this request to you?
Impactful. My app's user experience would be significantly compromised without it.
Suggested implementation
Similar to how we have a IsZoomControlEnabled to get Ctrl + +/- to work, I'd like a similar setting to get Ctrl+F to work without enabling everything else.
What does your app do? Is there a pending deadline for this request?
will have to implement the Find popup myself instead which is costly. by sometime EOY
ajtruckle I know that. Briefly glanced at it. Wasn't sure if they were proposing adding a Setting that will enable that accelerator by default. Didn't see that. Just thought it was concerned with adding APIs to show/find programmatically.
As ajtruckle mentioned, there is indeed a Find API in the works. It allows you to programmatically launch the find feature. This works independently of accelerator keys.
Victor Huang (@victorhuangwq) ok, so I'd still have to intercept Ctrl+F and call this API though, right? I was hoping there could be a setting that would automatically make Ctrl+F trigger the Find popup.
Additionall, the problem with intercepting it myself and setting e.Handled = true is that that prevents the web app code from getting the Ctrl+F hotkey. That might be ok in general, but it might be nice that if web code was listening for Ctrl+F, it got that event before the host app did.
@pushkin To my knowledge CTRL + F works. Does for me. But only when the browser has focus. This is why I am waiting for the API approach so I can handle the hotkey myself and not have the issues with focus, Keep in mind that the browser find dialog will be invoked so it will do all the donkey work. Not me. We do have a choice with the find api to just display it and let the browser manage it That is how I understand it..
________________________________
From: pushkin- ***@***.***>
Sent: 25 June 2024 20:48
To: MicrosoftEdge/WebView2Feedback ***@***.***>
Cc: ajtruckle ***@***.***>; Mention ***@***.***>
Subject: Re: [MicrosoftEdge/WebView2Feedback] [Feature]: add a setting to CoreWebView2Settings to enable Ctrl+F find (Issue #4639)
@victorhuangwq<https://github.com/victorhuangwq> ok, so I'd still have to intercept Ctrl+F and call this API though, right? I was hoping there could be a setting that would automatically make Ctrl+F trigger the Find popup.
Additionall, the problem with intercepting it myself and setting e.Handled = true is that that prevents the web app code from getting the Ctrl+F hotkey. That might be ok in general, but it might be nice that if web code was listening for Ctrl+F, it got that event before the host app did.
—
Reply to this email directly, view it on GitHub<#4639 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB45RM6IM3RJ2DX3UCCXAJDZJHCSTAVCNFSM6AAAAABJSXYV2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBZHA2DOOBSGY>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
ajtruckle My understanding is that Ctrl+F works because Settings::EnableBrowserAcceleratorKeys defaults to true. In my case, I don't want to enable all other accelerator keys, just ctrl+f so was looking for a separate setting to just control that one hotkey.
But webview2 already has the event handler for you to suppress hotkeys. So just use it, and suppress all hotkeys except CTRL + F. If that is what you want, then I don't see the difficulty. It is not a toggler but an event handler to decide to process the hotkey yourself let webview2 process it or eat it.
________________________________
From: pushkin- ***@***.***>
Sent: 25 June 2024 21:04
To: MicrosoftEdge/WebView2Feedback ***@***.***>
Cc: ajtruckle ***@***.***>; Mention ***@***.***>
Subject: Re: [MicrosoftEdge/WebView2Feedback] [Feature]: add a setting to CoreWebView2Settings to enable Ctrl+F find (Issue #4639)
@ajtruckle<https://github.com/ajtruckle> My understanding is that Ctrl+F works because Settings::EnableBrowserAcceleratorKeys defaults to true. In my case, I don't want to enable all other accelerator keys, just ctrl+f so was looking for a separate setting to just control that one hotkey.
—
Reply to this email directly, view it on GitHub<#4639 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB45RM2VO3AK7HK3D2QPBR3ZJHEMNAVCNFSM6AAAAABJSXYV2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBZHA3TANRRGQ>.
You are receiving this because you were mentioned.
ajtruckle My issue is that I don't want to blanket supress all other hotkeys. From my testing, if I suppress a hotkey at the host level (in a KeyDown event handler), it prevents the page I'm loading in the WebView2 control from getting the hotkey. If the page wants to handle the hotkey, I want it to get an opportunity to do so.
________________________________
From: pushkin- ***@***.***>
Sent: 25 June 2024 21:04
To: MicrosoftEdge/WebView2Feedback ***@***.***>
Cc: ajtruckle ***@***.***>; Mention ***@***.***>
Subject: Re: [MicrosoftEdge/WebView2Feedback] [Feature]: add a setting to CoreWebView2Settings to enable Ctrl+F find (Issue #4639)
@ajtruckle<https://github.com/ajtruckle> My understanding is that Ctrl+F works because Settings::EnableBrowserAcceleratorKeys defaults to true. In my case, I don't want to enable all other accelerator keys, just ctrl+f so was looking for a separate setting to just control that one hotkey.
—
Reply to this email directly, view it on GitHub<#4639 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB45RM2VO3AK7HK3D2QPBR3ZJHEMNAVCNFSM6AAAAABJSXYV2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBZHA3TANRRGQ>.
You are receiving this because you were mentioned.
________________________________
From: pushkin- ***@***.***>
Sent: 25 June 2024 21:10
To: MicrosoftEdge/WebView2Feedback ***@***.***>
Cc: ajtruckle ***@***.***>; Mention ***@***.***>
Subject: Re: [MicrosoftEdge/WebView2Feedback] [Feature]: add a setting to CoreWebView2Settings to enable Ctrl+F find (Issue #4639)
@ajtruckle<https://github.com/ajtruckle> My issue is that I don't want to blanket supress all other hotkeys. From my testing, if I suppress a hotkey at the host level (in a KeyDown event handler), it prevents the page I'm loading in the WebView2 control from getting the hotkey. If the page wants to handle the hotkey, I want it to get an opportunity to do so.
—
Reply to this email directly, view it on GitHub<#4639 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB45RM5G7UTK3PLW4WN577TZJHFELAVCNFSM6AAAAABJSXYV2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBZHA4DENBTGY>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
Also, I'm not using an AcceleratorKeyPressed event but the KeyDown event on the Control. I thought I read somewhere that AcceleratorKeyPressed isn't available anymore, or exists on the Controller or something which we might not have access to.
Regardless, this might work, but would I not have the same issue I mention above where if I handle an event at the host level (e.Handled = true), then the webapp won't receive those events (since host process gets them before WebView2 site?)
If there were a setting that would send the key presses to the webview2 control first and if they weren't handled/prevented there, then the host app would get the accelerator key press, that would be ideal.
Activity
ajtruckle commentedon Jun 23, 2024
You know that they are working on a custom Find API? It is still at development stage I think. Not sure of ETA.
pushkin- commentedon Jun 24, 2024
ajtruckle I know that. Briefly glanced at it. Wasn't sure if they were proposing adding a Setting that will enable that accelerator by default. Didn't see that. Just thought it was concerned with adding APIs to show/find programmatically.
victorhuangwq commentedon Jun 25, 2024
As ajtruckle mentioned, there is indeed a Find API in the works. It allows you to programmatically launch the find feature. This works independently of accelerator keys.
https://github.com/MicrosoftEdge/WebView2Feedback/pull/4399/files?short_path=a4e657f#diff-a4e657fb3aef3cc7b9a09b13af805de25931fdb082b2a93aeea46e45de10bb90
If your main purpose is for you to launch the Find popup, this would definitely work for this use case.
pushkin- commentedon Jun 25, 2024
Victor Huang (@victorhuangwq) ok, so I'd still have to intercept Ctrl+F and call this API though, right? I was hoping there could be a setting that would automatically make Ctrl+F trigger the Find popup.
Additionall, the problem with intercepting it myself and setting e.Handled = true is that that prevents the web app code from getting the Ctrl+F hotkey. That might be ok in general, but it might be nice that if web code was listening for Ctrl+F, it got that event before the host app did.
ajtruckle commentedon Jun 25, 2024
pushkin- commentedon Jun 25, 2024
ajtruckle My understanding is that Ctrl+F works because Settings::EnableBrowserAcceleratorKeys defaults to true. In my case, I don't want to enable all other accelerator keys, just ctrl+f so was looking for a separate setting to just control that one hotkey.
ajtruckle commentedon Jun 25, 2024
pushkin- commentedon Jun 25, 2024
ajtruckle My issue is that I don't want to blanket supress all other hotkeys. From my testing, if I suppress a hotkey at the host level (in a KeyDown event handler), it prevents the page I'm loading in the WebView2 control from getting the hotkey. If the page wants to handle the hotkey, I want it to get an opportunity to do so.
ajtruckle commentedon Jun 25, 2024
ajtruckle commentedon Jun 25, 2024
victorhuangwq commentedon Jun 27, 2024
pushkin- if all you want is to have Ctrl-F open up the find dialog, would the following be a viable approach?
falseCtrl-Fin the AcceleratorKeyPressed event, sincepushkin- commentedon Jun 27, 2024
Victor Huang (@victorhuangwq) I need to wait for the FInd API to be released first for that to work.
Also, I'm not using an AcceleratorKeyPressed event but the KeyDown event on the Control. I thought I read somewhere that AcceleratorKeyPressed isn't available anymore, or exists on the Controller or something which we might not have access to.
Regardless, this might work, but would I not have the same issue I mention above where if I handle an event at the host level (
e.Handled = true), then the webapp won't receive those events (since host process gets them before WebView2 site?)If there were a setting that would send the key presses to the webview2 control first and if they weren't handled/prevented there, then the host app would get the accelerator key press, that would be ideal.
ajtruckle commentedon Dec 2, 2024
#4399 (comment)
Nic Champagne Williamson [MSFT] (@champnic) This seems to be sat on for 5 months?