public static bool IsActivatedByEvent(this KeyMethod val, int wParam) { switch (val) { case KeyMethod.OnPress: return(wParam == Win32.WM_KEYDOWN || wParam == Win32.WM_SYSKEYDOWN); case KeyMethod.OnRelease: return(wParam == Win32.WM_KEYUP || wParam == Win32.WM_SYSKEYUP); } throw new Exception("Unknown KeyMethod: " + Enum.GetName(typeof(KeyMethod), val)); }
public static string ToFormattedString(this KeyMethod val) { switch (val) { case KeyMethod.OnPress: return("On Press"); case KeyMethod.OnRelease: return("On Release"); } throw new Exception("Unknown KeyMethod: " + Enum.GetName(typeof(KeyMethod), val)); }
public static void ChangeKeyMethod(KeyMethod newMethod) { Settings.KeyMethod = newMethod; }