diff --git a/ReactWindows/ReactNative.Net46/Touch/TouchHandler.cs b/ReactWindows/ReactNative.Net46/Touch/TouchHandler.cs index db879418647..71653436343 100644 --- a/ReactWindows/ReactNative.Net46/Touch/TouchHandler.cs +++ b/ReactWindows/ReactNative.Net46/Touch/TouchHandler.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using ReactNative.UIManager; using ReactNative.UIManager.Events; @@ -299,6 +299,10 @@ private void UpdatePointerForEvent(ReactPointer pointer, Point rootPoint, Point pointer.LocationX = (float)positionInView.X; pointer.LocationY = (float)positionInView.Y; pointer.Timestamp = (ulong) timestamp; + + pointer.ShiftKey = (Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift; + pointer.AltKey = (Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt; + pointer.CtrlKey = (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control; } private void DispatchTouchEvent(TouchEventType touchEventType, List activePointers, int pointerIndex) @@ -510,6 +514,15 @@ class ReactPointer [JsonProperty(PropertyName = "isEraser", DefaultValueHandling = DefaultValueHandling.Ignore)] public bool IsEraser { get; set; } + + [JsonProperty(PropertyName = "shiftKey", DefaultValueHandling = DefaultValueHandling.Ignore)] + public bool ShiftKey { get; set; } + + [JsonProperty(PropertyName = "ctrlKey", DefaultValueHandling = DefaultValueHandling.Ignore)] + public bool CtrlKey { get; set; } + + [JsonProperty(PropertyName = "altKey", DefaultValueHandling = DefaultValueHandling.Ignore)] + public bool AltKey { get; set; } } } } diff --git a/ReactWindows/ReactNative/Touch/TouchHandler.cs b/ReactWindows/ReactNative/Touch/TouchHandler.cs index ca27d2a935d..d3f8cd1dbce 100644 --- a/ReactWindows/ReactNative/Touch/TouchHandler.cs +++ b/ReactWindows/ReactNative/Touch/TouchHandler.cs @@ -7,6 +7,7 @@ using Windows.Foundation; using Windows.Foundation.Metadata; using Windows.Graphics.Display; +using Windows.UI.Core; using Windows.UI.Input; using Windows.UI.ViewManagement; using Windows.UI.Xaml; @@ -231,6 +232,10 @@ private void UpdatePointerForEvent(ReactPointer pointer, PointerPoint rootPoint, pointer.Timestamp = rootPoint.Timestamp / 1000; // Convert microseconds to milliseconds; pointer.Force = rootPoint.Properties.Pressure; pointer.IsBarrelButtonPressed = rootPoint.Properties.IsBarrelButtonPressed; + + 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); } private void DispatchTouchEvent(TouchEventType touchEventType, List activePointers, int pointerIndex) @@ -480,6 +485,15 @@ class ReactPointer [JsonProperty(PropertyName = "isEraser", DefaultValueHandling = DefaultValueHandling.Ignore)] public bool IsEraser { get; set; } + + [JsonProperty(PropertyName = "shiftKey", DefaultValueHandling = DefaultValueHandling.Ignore)] + public bool ShiftKey { get; set; } + + [JsonProperty(PropertyName = "ctrlKey", DefaultValueHandling = DefaultValueHandling.Ignore)] + public bool CtrlKey { get; set; } + + [JsonProperty(PropertyName = "altKey", DefaultValueHandling = DefaultValueHandling.Ignore)] + public bool AltKey { get; set; } } } }