diff options
author | Bertrand Le Roy <beleroy@microsoft.com> | 2018-12-01 03:55:33 +0300 |
---|---|---|
committer | Bertrand Le Roy <beleroy@microsoft.com> | 2018-12-03 20:20:14 +0300 |
commit | a326983fe76108701ebdcbc4ed31c74c32f7ed8c (patch) | |
tree | d1d18821e3c70c6c94d5f11f94397885d91df2db /Xamarin.PropertyEditing.Mac/Controls | |
parent | 701fe5ee0b619bde33d11f1230496bc925fdd0a1 (diff) |
Improve keyboard navigation for brush editors. This does not fix keyboard navigation inside the popup.
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs index d3f01e8..c2f50b7 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs @@ -30,8 +30,20 @@ namespace Xamarin.PropertyEditing.Mac if (Popover == null) return; - if (!Popover.Shown) + if (!Popover.Shown) { Popover.Show (new CGRect (26, this.Frame.Height / 2 - 2, 2, 2), this, NSRectEdge.MinYEdge); + Window.MakeFirstResponder (Popover); + } + } + + public override void KeyDown (NSEvent theEvent) + { + if (theEvent.KeyCode == 36 || theEvent.KeyCode == 49) { + MouseDown (theEvent); + } + else { + base.KeyDown (theEvent); + } } } |