コード例 #1
0
 internal string HelpToString()
 {
     return(string.Format("Controllers: \n Navigation : Left Stick {0} \n Normal Attack : A button {1}\n Supper Attack : X button {2}\n Shield: Left bumper {3}",
                          KeyboardEnabled ? "or keyboard " + KeyboardUp.ToString() + ", " + KeyboardDown.ToString() + ", " + KeyboardLeft.ToString() + ", " + KeyboardRight.ToString() : "",
                          KeyboardEnabled ? "or keyboard " + KeyboardHit.ToString() : "",
                          KeyboardEnabled ? "or keyboard " + KeyboardSuper.ToString() : "",
                          KeyboardEnabled ? "or keyboard " + KeyboardSheild.ToString() : ""));
 }
コード例 #2
0
ファイル: Hooks.cs プロジェクト: grafmen9999/MediaPlayer
        /// <summary>
        /// Hook process messages.
        /// </summary>
        /// <param name="nCode"></param>
        /// <param name="wParam"></param>
        /// <param name="lParam"></param>
        /// <returns></returns>
        static IntPtr HookProcFunction(int nCode, IntPtr wParam, IntPtr lParam)
        {
            if (nCode == 0)
            {
                KBLLHOOKSTRUCT pKBLLHOOKSTRUCT = (KBLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(KBLLHOOKSTRUCT));
                switch (wParam.ToInt32())
                {
                case WM_KEYDOWN:
                    KeyboardDown?.Invoke(null, new KeyEventArgs((Keys)pKBLLHOOKSTRUCT.vkCode));
                    //MessageBox.Show("OKAY, " + pKBLLHOOKSTRUCT.vkCode); // <--- DEBUG
                    break;

                case WM_KEYUP:
                    KeyboardUp?.Invoke(null, new KeyEventArgs((Keys)pKBLLHOOKSTRUCT.vkCode));
                    break;

                default:
                    break;
                }
            }

            return(API.CallNextHookEx(hHook, nCode, wParam, lParam));
        }
コード例 #3
0
ファイル: Runtime.cs プロジェクト: fire-eggs/CivOne
 internal void InvokeKeyboardUp(KeyboardEventArgs args) => KeyboardUp?.Invoke(this, args);