Sublime Forum

Using F12 key for Go To Definition

#1

Hi, I recently switched Mac keyboards and am using one (Macally USB-A) where the F12 key now has an eject icon on it instead of the volume up that my previous keyboard had (Apple Magic Keyboard).

I was previously able to just hit the F12 by itself and trigger a GoTo Definition. But now, I need to use the Fn+F12 combo to trigger the same. Any ideas on how I can get to the previous behavior?

ST Build# 4155

I tried this in my key bindings but it didn’t work

{ "keys": ["f12"], "command": "goto_definition" }

Thanks,
Bijoy

0 Likes

#2

Sublime can only read input from the keyboard, it can’t control how the OS or underlying hardware tell it what keys are. Or if you will, if you need to press fn in combination with a key, that is something that would need to be configured at the OS or hardware level to change.

That said, if you open the Sublime console with View > Show Console, enter sublime.log_input() and then press the key you want (without fn and Sublime can read that key, it will tell you what key it thinks it is; you can then use that in your key binding.

0 Likes