From a326983fe76108701ebdcbc4ed31c74c32f7ed8c Mon Sep 17 00:00:00 2001 From: Bertrand Le Roy Date: Fri, 30 Nov 2018 16:55:33 -0800 Subject: Improve keyboard navigation for brush editors. This does not fix keyboard navigation inside the popup. --- Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Xamarin.PropertyEditing.Mac/Controls') 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); + } } } -- cgit v1.2.3