I am having problems with how to distinguish between the Return key on my keyboard and the Enter key located on the numeric keypad.
I have had success in sharing other keys with duplicates such as CTRL , ALT and Shift using:
if(e.keyLocation == KeyLocation.RIGHT) // is on right side of keyboard or if(e.keyLocation == KeyLocation.LEFT) // is on left side of keyboard
However, when trying something like that, to highlight my Enter key from my Return key, using:
if(e.keyLocation == KeyLocation.NUM_PAD)
Flash insists on handling them like from KeyLocation.Standard . It is also worth mentioning that Flash treats both keys as the same key with the same keyCode (13) in the same way that CTRL , ALT and Shift use the same keyCode , but keyCode still cannot be isolated, as they can.
Does anyone have any ideas on how I can solve this problem? Or is it just a limitation with AS3? Thanks.
Edit: It may be worth noting that I am developing this for use with Adobe AIR as a desktop application.
source share