Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8743781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:44:17+00:00 2026-06-13T11:44:17+00:00

Hello and thank you for reading. I have an embedded WebBrowser in a Kiosk

  • 0

Hello and thank you for reading.

I have an embedded WebBrowser in a Kiosk style WPF application and I am attempting to prevent the user from being able to use the Ctrl + O or Ctrl + N keyboard shortcuts to circumvent the page that I have limited them to.

Here is my code which is in the top most window of the application:

// This is in the constructor of the window under InitializeComponent();
AddHandler(Keyboard.PreviewKeyDownEvent, (System.Windows.Input.KeyEventHandler)HandleKeyDownEvent);

private void HandleKeyDownEvent(object sender, System.Windows.Input.KeyEventArgs e)
{
   Key key = (e.Key == Key.System) ? e.SystemKey : e.Key;
   if(e.KeyboardDevice.Modifiers == ModifierKeys.Control)
   {
      switch(key)
      {
         case Key.N:
         case Key.O:
         case Key.P:
            MessageBox.Show("BOOM");
            break;
      }
   }
}

The event handler is properly triggering when I press Ctrl + N, but e.Key is Key.Control not Key.N. It appears that the event triggers immediately when the Ctrl button is pressed (as expected), but fails to capture the N key. I have tried using Keyboard.IsKeyDown(Key.N) and that returns false as well.

Any advice or suggestions are welcome.

Thanks,

Adam

EDIT: I have also tried to prevent a new window using the NewWindow, NewWindow2 and NewWindow3 events on the browser itself. No luck there either.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:44:18+00:00Added an answer on June 13, 2026 at 11:44 am

    Well I feel like a complete numb skull! Turns out it is as simple as adding the following line of code. I hope this helps other people that may be trying very overcomplicated solutions like I was.

         browser.WebBrowserShortcutsEnabled = false;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello and thank you for reading, I have a task to authenticate a un
hello, how can i set cookies like 'last_visit' if the user have more than
I have a bunch human reading simple sentence (hello world) as a wav file,
Hello everyone and thanks in advance for reading this.. I have the following html
Hello everybody and thanks for reading. I have this html; <i class=icon-plus icon-white> Test
hello all i have code from open source project that im integrating into my
I have a 2 part question on reading from sockets and how is it
hello i got a problem with reading from a file, i am trying to
Hello Good People !! I have a web application (my first of this type)
Hello, thanks for reading my question. I have a string that I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.