Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javascript: How to debug keyboard events

Imagine a web application which uses custom keyboard event handlers which might do event bubbling - or event catching.
Is there a way (e.g. Firefox/Firebug addon) to debug each keystroke/keyboard event, something like:

  • displaying the event type and all attributes
  • trace which javascript method had been called
  • in case of event bubbling which further methods have been called

To clarify my question: I don't know which method handlers exist and where they are defined - this is what I am trying to find out.

like image 505
MRalwasser Avatar asked Aug 16 '11 11:08

MRalwasser


People also ask

How do I use keyboard events in JavaScript?

There are three different keyboard events in JavaScript: keydown : Keydown happens when the key is pressed down, and auto repeats if the key is pressed down for long. keypress : This event is fired when an alphabetic, numeric, or punctuation key is pressed down. keyup : Keyup happens when the key is released.


1 Answers

You could try to visualize the vents with the Firebug + Eventbug extension.

For a general overview on keyboard events in different browsers, try this: http://unixpapa.com/js/key.html

like image 144
chiborg Avatar answered Sep 30 '22 03:09

chiborg