public static Key Convert (swi.Key key, swi.ModifierKeys modifier) { var keys = key.ToString () .Split (new[] { ", " }, StringSplitOptions.None) .Select (v => (swi.Key)Enum.Parse (typeof (swi.Key), v)); Key ret = Key.None; foreach (var val in keys) { ret |= Find (val); } if (modifier.HasFlag (swi.ModifierKeys.Alt)) ret |= Key.Alt; if (modifier.HasFlag (swi.ModifierKeys.Control)) ret |= Key.Control; if (modifier.HasFlag (swi.ModifierKeys.Shift)) ret |= Key.Shift; if (modifier.HasFlag (swi.ModifierKeys.Windows)) ret |= Key.Application; return ret; }