2011-07-26, 05:21 PM
I have existing code that does something in response to CTRL+B being pressed:
But I was wondering; should I actually be doing something with the KeyMappings.xml stuff and responding to that instead (ShowOSD in this case):
Obviously it must be better because then the user can change their mappings and have my plugin respond to some other key.
Is there an API trick to it (or even a C# one), or do I need to parse the XML and work it all out manually?
Iain
Code:
public override bool OnKeyDown(KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.B)
{
// do something...
But I was wondering; should I actually be doing something with the KeyMappings.xml stuff and responding to that instead (ShowOSD in this case):
Code:
<Key code="{CTRL}B" command="ShowOSD"/>
Obviously it must be better because then the user can change their mappings and have my plugin respond to some other key.
Is there an API trick to it (or even a C# one), or do I need to parse the XML and work it all out manually?
Iain