add forward_delete key on macos #272
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Noticed this while working on Fönn. For whatever reason pressing Cmd + backspace on macOS is encoded like so:
.{ .codepoint = 117, // == 0x75 .text = null, .shifted_codepoint = null, .base_layout_codepoint = null, .mods = .{ // note that `ctrl` is `true`, not `super`. Another oddity here. .shift = false, .alt = false, .ctrl = true, .super = false, .hyper = false, .meta = false, .caps_lock = false, .num_lock = false } }I don't know why macOS does this, but a quick lookup led me to
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/Events.h(on modern macOS systems as I understand it, the path has changed over the years) which has this section of code:Having this keycode makes it easier to read the input handling code, so I figured I'd contribute, but let me know if this is something you'd like to keep or not rockorager.
I'm not quite convinced that the compile time error for trying to use this on non-macos systems is needed, but I figured it'd be better to err on the side of caution here instead of adding a new constant that may or may not be universal.
I think it's macOS specific since it's part of Apple's Carbon framework.