示例#1
0
        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);
        }
示例#2
0
 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);
     }
 }
示例#3
0
 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);
     }
 }
示例#4
0
 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);
     }
 }
示例#5
0
 internal static void BringToFront(IntPtr window)
 {
     try
     {
         if (Environment.OSVersion.Platform == PlatformID.Win32NT)
         {
             Win32Platform.BringToFront(window);
         }
         else
         {
             LinuxPlatform.BringToFront(window);
         }
     }
     catch
     {
     }
 }
示例#6
0
        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;
        }
示例#7
0
 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);
 }