forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 138
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
macOS Keyboard Support #657
Merged
HeyImChris
merged 39 commits into
microsoft:master
from
HeyImChris:heyimchris/keyboarding
Dec 12, 2020
Merged
Changes from 12 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
8df39e1
Update RCTCxxBridge.mm
HeyImChris 4a9bcbd
Merge branch 'master' of https://github.com/microsoft/react-native-macos
HeyImChris e8d2d8b
Merge pull request #1 from microsoft/master
HeyImChris ab71c3b
Merge branch 'master' of https://github.com/microsoft/react-native-macos
HeyImChris e40c784
Merge branch 'master' of https://github.com/microsoft/react-native-macos
HeyImChris 204ddb3
Merge branch 'master' of https://github.com/microsoft/react-native-macos
HeyImChris b30a024
Merge branch 'master' of https://github.com/microsoft/react-native-macos
HeyImChris 4ac284e
Merge branch 'master' of https://github.com/microsoft/react-native-macos
HeyImChris 7f1863a
Merge branch 'master' of https://github.com/microsoft/react-native-macos
HeyImChris eec7a79
Merge branch 'master' of https://github.com/microsoft/react-native-macos
HeyImChris 136032a
macOS keyboard support
HeyImChris 119f027
update comment
HeyImChris a76bcc1
Merge branch 'master' of https://github.com/microsoft/react-native-macos
HeyImChris 7d85560
Merge branch 'master' of https://github.com/microsoft/react-native-macos
HeyImChris 90f0cff
add key value checks so we don't send all events
HeyImChris 508ac92
macOS keyboard support
HeyImChris 1d1ff14
update comment
HeyImChris 78d8e19
add key value checks so we don't send all events
HeyImChris 5dcd7ce
[ado] Workaround homebrew openssl issue (#669)
alloy c56dff7
Fix detox yarn error with Xcode 12 (#670)
HeyImChris 6b3487d
only use valid keys, bubble events to super
HeyImChris 8568622
Merge branch 'heyimchris/keyboarding' of https://github.com/HeyImChri…
HeyImChris 7011dc4
Merge branch 'master' of https://github.com/microsoft/react-native-macos
HeyImChris 5894111
macOS keyboard support
HeyImChris ecc351c
update comment
HeyImChris 2fee2cc
add key value checks so we don't send all events
HeyImChris b40eace
only use valid keys, bubble events to super
HeyImChris 8620c29
macOS keyboard support
HeyImChris dfb3d4a
add key value checks so we don't send all events
HeyImChris 9a43360
Merge branch 'heyimchris/keyboarding' of https://github.com/HeyImChri…
HeyImChris 0c46c4a
resolve bad merge
HeyImChris 5ee1b50
update valid key bug, api typo
HeyImChris 7ff3849
spacing fix
HeyImChris 9eefe91
Merge branch 'master' into heyimchris/keyboarding
HeyImChris 974da4b
fix flow errors
HeyImChris c29f431
Merge branch 'heyimchris/keyboarding' of https://github.com/HeyImChri…
HeyImChris 6655bb9
fix snapshot tests for new APIs
HeyImChris c87d38b
yarn lint --fix
HeyImChris 263182e
fix flipper
HeyImChris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For extra context, react-native-windows did this a slightly different way. There, we translate key events seen by Pressability into press events, instead of having Pressability emit key events. This matches some legacy behavior, but it also means press event shape is unexpected when press happens by keyboard activation.
If you want raw pass through, it might be simpler to just avoid passing the handlers from Pressable/Touchable to Pressability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we get state change visuals on keyboard with this? IIRC hooking into the Pressability state machine gave us those for free.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mimics the pattern we used for onFocus and onBlur for macOS. What do you mean by state change visuals on keyboard?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand properly, windows treats onKeyUp as onPressIn, and onKeyDown as onPressOut. Then, any visuals that might be associated with the pressed state of a perusable also happen on key press. This sounds like a desirable behavior that I think we'd want to incorporate...
I just checked and it looks like react-native-windows is still doing the same thing, so I guess the flow problems were worth the trade off?