# Making a keyboard shortcut using the Fn (function) key on OS X

A lot of my use for Mathematica is creating notebooks that read like textbooks. For this reason, most of my time is spent in text cells. As I type in a text cell, I am constantly creating inline cells. I find the Control + 9 method for creating an inline cell annoying, difficult and time consuming.

I'm hoping to use the Fn key on the lower left-hand side of the keyboard instead of having to type Control + 9. This would be easier because its one key and its easy to get to. On top of that, I never use the Fn key for anything... so its available.

I can't seem to figure out how to do this. I know its possible. I've tried using modifying keyeventtranslations. Currently I have the following code in keyeventtranslations.nb

Item[KeyEvent["9", Modifiers -> {Control}], "CreateInlineCell"]


It seems it would be easy to do what I want if I knew the keyevent for the Fn key. But I don't. I don't think Mathematica recognizes this key at all for some reason. I can't seem to find it anywhere in the documentation either. So this leads to a dead end as far as I can tell.

Do you have any advice on go about going this another way?

• Does Item[KeyEvent["F9"], ...] (for the function key 9) work? Looking at the file KeyEventTranslations.tr, it seems to be done this way. (I did not try it myself.) – user31159 Nov 11 '16 at 1:32
• No this doesn't work either. I don't think Mathematica recognizes the functions keys at all. I'm thinking there is probably a way hack this by creating a hot key in OS X settings that creates a character which Mathematica recognizes which then turns into "CreateInlineCell". Kind of a shortcut to a shortcut to the solution. But I can't figure it out. – Michael McCain Nov 11 '16 at 1:44
• I just tried it on Windows and it doesn't work as well. I tried also with a few modifiers but without success. I can see at the end of the file "F1" and "F2" being used, and I interpreted the former as the shorcut for opening the documentation center. Now I am seeing that this is SelectionHelpDialog[False] and not the token "SelectionHelpDialog", so maybe this is for another thing. I am not sure how one can get the function keys to work, which could be really nice indeed. – user31159 Nov 11 '16 at 2:14
• This may not be possible, at least not directly in Mathematica. This is a very special modifier that is used to type keys that are not physically present on a laptop keyboard. Mathematica probably isn't even able to see this as a separate key. I mean that when you type Fn-Down, it probably sees it as the same PgDn as the one you could type on a large keyboard having a separate PgDn key. It probably doesn't see it as Down with the Fn modifier. – Szabolcs Nov 11 '16 at 21:33
• Ok. What about the caps lock key? Can I edit keyeventtranslations.nb to make the caps lock key create inline cells? – Michael McCain Nov 11 '16 at 21:35