Skip to content

Conversation

@reseul
Copy link
Contributor

@reseul reseul commented Mar 5, 2018

No description provided.

pointer.ShiftKey = Window.Current.CoreWindow.GetKeyState(Windows.System.VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down);
pointer.AltKey = Window.Current.CoreWindow.GetKeyState(Windows.System.VirtualKey.Menu).HasFlag(CoreVirtualKeyStates.Down);
pointer.CtrlKey = Window.Current.CoreWindow.GetKeyState(Windows.System.VirtualKey.Control).HasFlag(CoreVirtualKeyStates.Down);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to implement this key or add an API for core window keyboard events to JavaScript? I guess the concern with doing it in JavaScript is that it's asynchronous (something could get out of sync between the keyboard state and the click event)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I followed the "stamp the modifier keys at event creation moment" pattern.
If by API you mean a notification pipe from native to JS that keeps some JS state in sync with the kbd state, I just didn't think the complexity would warrant the perf gain.


In reply to: 172177315 [](ancestors = 172177315)

@reseul reseul merged commit cdf41be into microsoft:master Mar 5, 2018
@reseul reseul deleted the kbd_modifiers branch March 7, 2018 16:55
ladipro pushed a commit to ladipro/react-native-windows that referenced this pull request May 16, 2018
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

Successfully merging this pull request may close these issues.

2 participants