Created
May 28, 2012 03:59
-
-
Save timdream/2817145 to your computer and use it in GitHub Desktop.
Key event test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html manifest="manifest.appcache"> | |
<body> | |
Tap on the black space to test key events bubbling from mozbrowser. | |
Tap on the red space to test key events bubbling from mozbrowser within mozbrowser. | |
<iframe width=400 height=600 mozbrowser src="data:text/html,<body bgcolor=black><iframe mozbrowser src='data:text/html,<body bgcolor=red>'></iframe></body>"></iframe> | |
<script> | |
['keydown', 'keypress', 'keyup'].forEach(function (type) { | |
window.addEventListener(type, function (evt) { | |
dump('==== ' + evt.type + ', ' + evt.keyCode + ', ' + evt.eventPhase + ', ' + evt.target); | |
}, false, true); | |
window.addEventListener(type, function (evt) { | |
dump('==== ' + evt.type + ', ' + evt.keyCode + ', ' + evt.eventPhase + ', ' + evt.target); | |
}, true, true); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment