that sounds weird, did you already try hooking up Adobe Scout and analyze the output when you press a key?
What Framework are you using (if any) and is this a desktop or a mobile/tablet application?
I'm using no frameworks. Adobe Scout tells me that there is handling 2 "keyDown" events, but i use NO keyboard event listeners. Desktop application.
Can you find out what exactly is receiving the events?
What if you create your own event listener that captures all keyboard events and preventDefault() ?
Ok, first of all, i've transfered project from flash Air to pure flash. Mouse lags stops, but when pressing a key, there's a drop of FPS.
I've created event listeners for KEY_UP and KEY_DOWN and set there event.preventDefault(). I'ts done nothing. When i looked in adobe scout, there is 4 keyboard event listeners now: 2x"keyDown" , 2x"keyPress". It's very strange.
Then i deleted this listeners and start again, pushed some buttons. Checked adobe scout - in one frame there were 6 key listeners: 2x"keyDown" , 2x"keyPress", 2x"keyUp". I'm confused.
Can mouse event listeners check for some key actions? for example if they are checking for pressing shift or ctrl keys.
I've made one test. Made some additional calculations to overload cpu. My fps drops to 20. Now adobe scout shows that in one frame there was 4 keyListener processing and 5 mouse event listeners "mouseMove". Maybe when fps drops lower than project framerate, listeners can act more than one time?
1 person found this helpful
Well yeh it might be that there are some "default" listeners running for system keys, and yeh event listeners as long as not removed are being dispatched at every frame. Although I never experienced something like you describe, what kind of application are you building that uses so much resources?
I once had a similar issue while building a game with Starling and everytime I moved the mouse the game lagged (frame drop to 15fps instead of 60fps), cause was the GPU / CPU / DIRECT mode (not sure anymore which was causing the problems).