-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: add a setting to CoreWebView2Settings to enable Ctrl+F find #4639
Comments
You know that they are working on a custom Find API? It is still at development stage I think. Not sure of ETA. |
@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. If your main purpose is for you to launch the Find popup, this would definitely work for this use case. |
@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. |
Lookup:
add_AcceleratorKeyPressed
event.
…________________________________
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.
|
OK, then I bail out of the conversation and leave you in the hands of the WV2 Gurus. 😀
…________________________________
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: ***@***.***>
|
@pushkin- if all you want is to have Ctrl-F open up the find dialog, would the following be a viable approach?
|
@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 ( 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. |
@champnic This seems to be sat on for 5 months? |
Describe the feature/enhancement you need
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
The text was updated successfully, but these errors were encountered: