private static IntPtr KbHookCallback(int nCode, IntPtr wParam, IntPtr lParam)
    {
        if (nCode >= 0 && wParam == (IntPtr)KeyboardMessages.WM_KEYDOWN)
        {
            int vkCode = Marshal.ReadInt32(lParam);
            RainityInput.SetKeyCodeDown((uint)vkCode);
        }
        if (nCode >= 0 && wParam == (IntPtr)KeyboardMessages.WM_KEYUP)
        {
            int vkCode = Marshal.ReadInt32(lParam);
            RainityInput.SetKeyCodeUp((uint)vkCode);
        }

        return(CallNextHookEx(_kbHookID, nCode, wParam, lParam));
    }
예제 #2
0
    public void Start()
    {
        SetupDesktop.windowOffset    = windowOffset;
        SetupDesktop.hideFromTaskbar = hideFromTaskbar;
        SetupDesktop.neverHide       = neverHideWindow;
        SetupDesktop.keepBottomMost  = keepBottomMost;
        SetupDesktop.borderless      = borderless;
        SetupDesktop.behindIcons     = behindIcons;
        SetupDesktop.Initialize();

        SetupDesktop.AddWinProc();

        if (useRainityInput)
        {
            RainityInput.Initialize();
        }

        Application.runInBackground = true;
    }
 public override bool GetButtonDown(string buttonName)
 {
     return(RainityInput.GetButtonDown(buttonName));
 }
 public override bool GetMouseButton(int button)
 {
     return(RainityInput.GetMouseButton(button));
 }