Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: support macOS fn (globe) key in keymap #506

Open
xezrunner opened this issue Jan 23, 2025 · 0 comments
Open

Feature request: support macOS fn (globe) key in keymap #506

xezrunner opened this issue Jan 23, 2025 · 0 comments

Comments

@xezrunner
Copy link

xezrunner commented Jan 23, 2025

In other editors that I use on macOS, such as Visual Studio Code, fn (the globe key on Apple keyboards) can be used as a modifier with keyboard shortcuts:

Image

Despite the warning, the combination does work:

Screen.Recording.2025-01-23.at.20.08.35.mov

As far as I know:

  • on Windows (and Linux?), a "function key" is not defined as a key, since many generic keyboards use it as a reserved modifier in hardware/drivers to do their own functionality (such as backlight, volume etc.)
  • in contrast, on macOS, the fn (globe) key, at least on first-party Apple keyboards, is a first-class, valid modifier to use in combination with other keys, at least using NSEvent (https://developer.apple.com/documentation/appkit/nsevent/modifierflags-swift.struct/function)

I do not have access to the closed beta of Jai, so I am unsure whether this is something that's more relevant for an input-related Jai module that's being used here.

I'm not sure whether supporting this for macOS alone would be worth it either, considering other platforms don't define an fn key/modifier the same way.

focus/src/config_parser.jai

Lines 1249 to 1262 in 7e88514

if to_lower_copy_new(mod_key,, temp) == {
case "ctrl"; combo.mods.ctrl_pressed = true;
case "shift"; combo.mods.shift_pressed = true;
case "alt"; combo.mods.alt_pressed = true;
case "opt"; combo.mods.alt_pressed = true;
case "cmd"; combo.mods.cmd_meta_pressed = true;
case "meta"; combo.mods.cmd_meta_pressed = true;
case "super"; combo.mods.cmd_meta_pressed = true;
case "{ctrl}"; combo.ignore.ctrl_pressed = true;
case "{shift}"; combo.ignore.shift_pressed = true;
case "{alt}"; combo.ignore.alt_pressed = true;
case "{cmd}"; combo.ignore.cmd_meta_pressed = true;
case "{meta}"; combo.ignore.cmd_meta_pressed = true;
case "{super}"; combo.ignore.cmd_meta_pressed = true;

@xezrunner xezrunner changed the title Missing support for macOS fn (Globe) key in keymap Feature request: Support for macOS fn (globe) key in keymap Jan 23, 2025
@xezrunner xezrunner changed the title Feature request: Support for macOS fn (globe) key in keymap Feature request: support macOS fn (globe) key in keymap Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant