KeyCode doesn’t work equally on Mac & Win

By | December 29, 2006

Something quite frustrating I just notice today, the keyCode aren’t the same on a mac and on a pc…
This little code will work correctly on my pc but not on my mac (with ActionScript 3.0):
if (e.keyCode == F_KEY && e.ctrlKey == true) {...}
Seems that the command + KEY is always reserved to the browser and is not shared with the Flash Player (9) in mac. Or am I missing something here ?


0 Kudos

4 thoughts on “KeyCode doesn’t work equally on Mac & Win

  1. Pingback: Metah Blog

  2. Mike J

    I’ve found that it’s not so much an issue with OS as it is with browsers – different browsers will capture different keystrokes and not pass them through. Especially frustrating when you’re trying to provide application shortcut keys to match standards.

  3. nich

    not sure, as i’m not a java developer, but the command button is not the control button. macs have a command, option(alt) and control button.

    dunno, maybe i’m way off

  4. Ahmet

    Well i thought it’s a bit relevant on OS, ctrl+Key works in Firefox 2.0 on pc but not on mac.

    And the Ascii code of ctrl on pc is 17 and on mac the command Ascii code is also 17. That why we press command F for search on mac and control F on pc.

    But thanks 🙂 I’m sure there is a possible hack about this.