DEC / ASCII codes for ALL mac keys

07
2014-07
  • JShoe

    I have a few questions:

    1: Which key codes are used in Terminal? DEC right?

    2: How do I find the values of all my keys? Any program I have found to do it for you won't work on function keys which is what I want. Eventually, I want to be able to change my key lighting from Terminal using key press commands.

  • Answers
  • ubiquibacon

    Some quick research turned up a tool called Except which can be used to automate tasks in the terminal (like sending key codes), though the difficulty level of using it may be beyond what you want. Check out this SO question for a few more (less likely to work) options.


  • Related Question

    How do I press the Fn key using a PC keyboard on a Mac?
  • AlexMax

    I am in a bit of a pickle. I am using a Dell keyboard with Mac OS X, and I would like access to my function keys while I'm using Terminal. A friend of mine has a new Mac keyboard which has a Fn key right on it, but when I press the same location on my keyboard my cursor simply turns into a question mark, apparently this is treated as the 'help' key from older model mac keyboards.

    I know that I can change my function keys to work properly using an option from the Keyboard preference pane, but I don't want to do that because the ONLY time I need my function keys is when I'm in terminal, other times I am fine with things like volume adjustment etc. so I'd rather have a Fn key. I have also looked in "Modifier Keys . . .", and it allows you to redefine the caps lock, ctrl, alt and shift keys, but not assign anything to Fn (which is a shame, I use Caps Lock as my Ctrl and the 'real' Ctrl would be a perfect Fn key)

    So...is there any way to 'press Fn' on older mac keyboards or on third party keyboards?

    EDIT: To clarify, my dell keyboard does NOT have a Fn key on it. The place on my friends Mac keyboard that functions as an Fn key is an Insert key on mine.


  • Related Answers
  • Kio Dane

    You can use an application like ControllerMate to assign custom actions/scripts to keys and controllers.

  • 8088

    The Fn key on mac keyboards is a hardware driven feature.

    What are you trying to accomplish?

    I have a Microsoft Wireless keyboard attached to my MacBook Pro and can do much of what the function keys do from this -- once I installed the drivers.

    enter image description here

    For example, I can:

    • hit the volume, mute keys and play/pause to control audio
    • hit the "mail" key to go back to mail
    • I have F keys for Exposé features (e.g. F9 for all windows display, F10 for application windows

    (Note that in Keyboard Preferences, I have "Use all F1, F2, etc. keys as standard function keys" checked)

    I think the only feature that Fn provides that I cannot duplicate on the Microsoft keyboard is brightness control

  • richardkmiller

    I found this post helpful:

    http://david.rothlis.net/keyboards/microsoft_natural_osx/

    The Function keys (F1, etc) behave as such (as opposed to brightness, volume, etc), regardless of what you set in the Keyboard preference pane. If you press “F Lock” the F keys simply do nothing. Luckily the F Lock remembers its setting across reboots.

    There is no Fn modifier key as on the Mac keyboards.

    KeyRemap4MacBook allows you to map the F keys to the usual brightness, volume, etc. but then you’d lose the normal F keys.

  • Raystafarian

    I landed here with the same problem. I have a Microsoft natural keyboard. I had tried everything and then I went into keyboard settings and checked Use all F1 F2 ETC as standard function keys.

    I then went back to my keyboard and systematically went through combining one key with one FE that I knew worked with Exposé. I hit pay dirt when I hit the F lock key.

    So I think the answer is - enable standard F key in Mac, find F-LOCK key on keyboard and enable it the same way you would enable CAP Locks.

  • Benjamin Schollnick

    Just tested over here with a Dell keyboard, and I was not able to turn off the F-keys from being the "function" key (eg. Expose, etc). That option seems only to be available with Apple branded keyboards....

    So, without patching with a software driver, or hacking a plist... I don't see any way to do this...