Assigned Keys value should be returned instead of Keys.None
Actual Behavior
It always returns Keys.None on macOS
Steps to Reproduce the Problem
Access ShortCut property on a MenuItem instance on macOS
Code that Demonstrates the Problem
using Eto.Drawing;
using Eto.Forms;
namespace EtoApp
{
public class MainForm : Form
{
public MainForm()
{
Title = "My Eto Form";
ClientSize = new Size(400, -1);
var layout = new StackLayout { Padding = 10 };
layout.Items.Add(new Label { Text = "Right click for the context menu" });
var command = new Command((s, a) => Console.WriteLine("It works")) { MenuText = "Console write", Shortcut = Keys.F2 };
var buttonMenuItem = new ButtonMenuItem(command);
layout.ContextMenu = new ContextMenu(buttonMenuItem);
Console.WriteLine("Shortcut: " + buttonMenuItem.Shortcut); // -> This line does not print F2 on macOS
Content = layout;
}
}
}
menuItem.ShortCut
always returnsKeys.None
on macOS. The related place is as far as I can see is this place:https://github.com/picoe/Eto/blob/59c559d8d3affba153d92eb3601ef533a3ac5984/src/Eto.Mac/KeyMap.cs#L69
Expected Behavior
Assigned
Keys
value should be returned instead ofKeys.None
Actual Behavior
It always returns
Keys.None
on macOSSteps to Reproduce the Problem
MenuItem
instance on macOSCode that Demonstrates the Problem
Specifications