After creating a function that uses events to determine which button a user pressed by utilizing the event.key property, I encountered an issue. When assigning a type Event as a parameter for the function, the compiler generates an error message stating that
Property 'key' does not exist on type 'Event'.
Below is my code snippet:
function getDirection(e:Event):void{
let directionCode:number = e.key;
// add more code here
}
I'm puzzled as to why the key property isn't recognized in this instance of the event type.