- Thread starter
- #21
OK, I managed to implement the keyboard shortcuts and it was very simple. I found out in mainform.cs within the function
private void MainForm_KeyPress(object sender, KeyPressEventArgs e) I was able to check the value of key.name and call inputManager.KeyPress. For example:
if (key.Name == "p")
{
IInputManager inputManager = Common.ServiceRegistration.Get<IInputManager>();
inputManager.KeyPress(Key.Pause);
}
I will hardcode the keyboard shortcuts as I have no time to write a utility to allow users to map their own keys. However, I will store the keyboard shortcuts in a C# Dictionary collection, thus map key to action using the dictionary. Somebody else can write a simple utility to allow users to map their own keys and consequently replace the dictionary with the user-defined mappings.
I will commit the code in the next couple of days - need to work out how to commit code in GitHub
private void MainForm_KeyPress(object sender, KeyPressEventArgs e) I was able to check the value of key.name and call inputManager.KeyPress. For example:
if (key.Name == "p")
{
IInputManager inputManager = Common.ServiceRegistration.Get<IInputManager>();
inputManager.KeyPress(Key.Pause);
}
I will hardcode the keyboard shortcuts as I have no time to write a utility to allow users to map their own keys. However, I will store the keyboard shortcuts in a C# Dictionary collection, thus map key to action using the dictionary. Somebody else can write a simple utility to allow users to map their own keys and consequently replace the dictionary with the user-defined mappings.
I will commit the code in the next couple of days - need to work out how to commit code in GitHub
Last edited: