1. Aart Onkenhout
  2. PowerBuilder
  3. Tuesday, 26 March 2024 10:00 AM UTC

Hi,

I like to prevent the F12 key from opening devtools in my application. I looked into the acceleratorkeypressed event, which fires when pressing F12 (virtualkey 123). There is, however, no option to stop processing it (as far as I can see). According to https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.winforms.webview2.acceleratorkeypressed?view=webview2-dotnet-1.0.705.50 there should be a 'handled' property that must be set to true. Unfortunately, that property doesn't exist within powerbuilder. I tried setting Message.Processed to TRUE and Mesaage.ReturnValue to 1. That's not working.

So, is it possible to prevent opening the devtools window on pressing F12?

Kind regards,

Aart Onkenhout

Aart Onkenhout Accepted Answer Pending Moderation
  1. Tuesday, 26 March 2024 14:50 PM UTC
  2. PowerBuilder
  3. # 1

Hi Chris,

Thank you for your suggestion. I hadn't tried that option, so I added an invisible menuitem to my menu and added F12 as a shortcut key. Unfortunately, as soon as I set focus to the webbrowser control F12 opens the devtools window.

 

Regards, Aart

 

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 26 March 2024 14:58 PM UTC
Hi Aart;

Ahhh .. it sounds like the WB Control might be running it's own sub-message queue.If that is the case, then it's stealing away the main O/S message queue (like the DataWindow does) and after processing the message may / may not "chain" the message back on to the main O/S message queue so that other controls can see it.

This sounds like we might need to have to ask the Engineering team for an enhancement for this control (as it's really the WebVew2 engine under-the-hood) that needs further message handling capabilities. Just my guess.

Regards .. Chris
  1. Helpful 1
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 26 March 2024 12:48 PM UTC
  2. PowerBuilder
  3. # 2

Hi Aart;

  Have you tried using a menu with an invisible menu item assigned to F12? The menu should steal the F12 away from the current dialogue.  HTH 

Regards... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.