1

I'm creating an app where I have a WebBrowser Control loading a webpage, removing some elements of this webpage leaving only visible a Flash Game.

This game has a function which only works by pressing Tab on your keyboard. When I press Tab for the first time, the game captures it and triggers the function but when I press Tab for the second time, the WebBrowser acts like it's switching between elements and I can never use Tab again on the game.

What can I do to remove this "switch between elements" feature?

Blorgbeard
  • 101,031
  • 48
  • 228
  • 272
  • I'm not convinced that web browsers can be altered to do what you want to do. And in any case, do you really want a web browser to behave in a way that doesn't agree with users' common expectations? What happens if the user clicks first on another object, that object gets focus, so the tab key press goes straight to that particular object and you don't get even the first tab keypress ? Is that a possibility? – Cecil Ward Aug 30 '16 at 23:11
  • I'm assuming that there is at least one other control still in existence for the user to tab-switch the focus to. Otherwise I imagine that tab would just cycle round a circle of circumference one straight back to the one and only control every time. – Cecil Ward Aug 30 '16 at 23:14
  • @CecilWard I only have a game on the center of the webpage. But it acts like I'm switching between some element that I don't even see and, after that, it just never goes back to the game... –  Aug 30 '16 at 23:16

1 Answers1

1

You just need to capture the event by adding a handler on all elements of the page.

try something like this ...

Capturing TAB key in text box

Community
  • 1
  • 1
War
  • 8,539
  • 4
  • 46
  • 98