I'm trying to use Javascript to intercept keyboard events, so I can do CMD-W for a "closed window" and something else inside the Flash application, so the browser will not be able to use them.
Well, I can listen to ALT, CTRL and CMD onKeyDown / onKeyPress, but I canโt listen to anything ... Here is the code in the index.html file from the Flex project
<script language="JavaScript" type="text/javascript"> document.onkeydown = function(event) {applicationKeyboardHandler(event)} document.onkeypress = function(event) {applicationKeyboardHandler(event)} function applicationKeyboardHandler(event) { alert("Key Pressed") } </script>
code>
I would like to make it listen to any keystroke, not just alt / ctrl / cmd. What am I missing?
javascript flex externalinterface
Lance pollard
source share