示例#1
0
        public virtual void OnKeyboardAction(KeyBoardAction action, Key k)
        {
            Dispatcher.Invoke(new Action(() =>
            {
            }));

            //throw new NotImplementedException();
        }
示例#2
0
 private static IntPtr HookKeyboardCallBack(
     int nCode, IntPtr wParam, IntPtr lParam)
 {
     if (nCode >= 0)
     {
         KBDLLHOOKSTRUCT hookStruct = Marshal.PtrToStructure <KBDLLHOOKSTRUCT>(lParam);
         KeyBoardAction?.Invoke((EventMessage)wParam, hookStruct);
     }
     return(CallNextHookEx(_hookID, nCode, wParam, lParam));
 }
示例#3
0
文件: Utilities.cs 项目: zadop/LogOut
        private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
        {
            if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN)
            {
                if (Settings.saveKey)
                {
                    Settings.logOutHotKey = Marshal.ReadInt32(lParam);
                }
                if (Marshal.ReadInt32(lParam) == Settings.logOutHotKey)
                {
                    KeyBoardAction?.Invoke(null, new EventArgs());
                }
            }

            return(CallNextHookEx(_hookID, nCode, wParam, lParam));
        }