private bool OnHotKeyHandler(int inkey, int mod, bool ispressed) { int key = checkForOmeKeys(inkey); if (ispressed && !Enum.IsDefined(typeof(SDL_Keycode_Ignore), key)) { RazorEnhanced.ModKeys cur = RazorEnhanced.ModKeys.None; SDL_Keymod keymod = (SDL_Keymod)mod; if (keymod.HasFlag(SDL_Keymod.KMOD_LCTRL) || keymod.HasFlag(SDL_Keymod.KMOD_RCTRL)) { cur |= RazorEnhanced.ModKeys.Control; } if (keymod.HasFlag(SDL_Keymod.KMOD_LALT) || keymod.HasFlag(SDL_Keymod.KMOD_RALT)) { cur |= RazorEnhanced.ModKeys.Alt; } if (keymod.HasFlag(SDL_Keymod.KMOD_LSHIFT) || keymod.HasFlag(SDL_Keymod.KMOD_RSHIFT)) { cur |= RazorEnhanced.ModKeys.Shift; } return(RazorEnhanced.HotKey.OnKeyDown(Win32Platform.MapKey(key), cur)); } return(true); }
internal static IntPtr CaptureScreen(IntPtr handle, bool isFullScreen, string msgStr) { if (Environment.OSVersion.Platform == PlatformID.Win32NT) { return(Win32Platform.CaptureScreen(handle, isFullScreen, msgStr)); } else { return(IntPtr.Zero); } }
internal static bool SetForegroundWindow(IntPtr hWnd) { if (Environment.OSVersion.Platform == PlatformID.Win32NT) { return(Win32Platform.SetForegroundWindow(hWnd)); } else if (Environment.OSVersion.Platform == PlatformID.Unix) { return(LinuxPlatform.SetForegroundWindow(hWnd)); } else { return(false); } }
internal static ushort GetAsyncKeyState(int key) { if (Environment.OSVersion.Platform == PlatformID.Win32NT) { return(Win32Platform.GetAsyncKeyState(key)); } else if (Environment.OSVersion.Platform == PlatformID.Unix) { return(LinuxPlatform.GetAsyncKeyState(key)); } else { return(0); } }
internal static void BringToFront(IntPtr window) { try { if (Environment.OSVersion.Platform == PlatformID.Win32NT) { Win32Platform.BringToFront(window); } else { LinuxPlatform.BringToFront(window); } } catch { } }
private bool OnHotKeyHandler(int key, int mod, bool ispressed) { if (ispressed && !Enum.IsDefined(typeof(SDL_Keycode_Ignore), key)) { ModKeys cur = ModKeys.None; SDL_Keymod keymod = (SDL_Keymod) mod; if (keymod.HasFlag(SDL_Keymod.KMOD_LCTRL) || keymod.HasFlag(SDL_Keymod.KMOD_RCTRL)) cur |= ModKeys.Control; if (keymod.HasFlag(SDL_Keymod.KMOD_LALT) || keymod.HasFlag(SDL_Keymod.KMOD_RALT)) cur |= ModKeys.Alt; if (keymod.HasFlag(SDL_Keymod.KMOD_LSHIFT) || keymod.HasFlag(SDL_Keymod.KMOD_RSHIFT)) cur |= ModKeys.Shift; return HotKey.OnKeyDown(Win32Platform.MapKey(key), cur); } return true; }
private bool OnHotKeyHandler(int key, int mod, bool ispressed) { if (ispressed) { ModKeys cur = ModKeys.None; SDL_Keymod keymod = (SDL_Keymod)mod; if (keymod.HasFlag(SDL_Keymod.KMOD_LCTRL) || keymod.HasFlag(SDL_Keymod.KMOD_RCTRL)) { cur |= ModKeys.Control; } if (keymod.HasFlag(SDL_Keymod.KMOD_LALT) || keymod.HasFlag(SDL_Keymod.KMOD_RALT)) { cur |= ModKeys.Alt; } if (keymod.HasFlag(SDL_Keymod.KMOD_LSHIFT) || keymod.HasFlag(SDL_Keymod.KMOD_RSHIFT)) { cur |= ModKeys.Shift; } return(HotKey.OnKeyDown(Win32Platform.MapKey(key), cur)); } return(true); }