Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="aMessage"></param>
        /// <param name="shouldRaiseAction"></param>
        /// <returns></returns>
        public List <MediaPortal.InputDevices.HidUsageAction.ConditionalAction> ProcessInput(Message aMessage, bool shouldRaiseAction = true)
        {
            _shouldRaiseAction = shouldRaiseAction;
            //Processing HID events
            _handler.ProcessInput(ref aMessage);

            return(_actions);
        }
        private int HidEventThreadWndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
        {
            var message = new Message {
                HWnd = hWnd, LParam = lParam, WParam = wParam, Msg = (int)msg
            };

            _hidHandler?.ProcessInput(ref message);
            return(NativeMethods.DefWindowProc(hWnd, msg, wParam, lParam));
        }
Exemple #3
0
 protected override void WndProc(ref Message message)
 {
     switch (message.Msg)
     {
     case Const.WM_INPUT:
         message.Result = new IntPtr(0);
         iHidParser.ProcessInput(ref message);
         break;
     }
     //Is that needed? Check the docs.
     base.WndProc(ref message);
 }
Exemple #4
0
        private int HidEventThreadWndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
        {
            const int WM_INPUT = 0x00FF;
            var       message  = new Message {
                HWnd = hWnd, LParam = lParam, WParam = wParam, Msg = (int)msg
            };

            if (message.Msg == WM_INPUT)
            {
                _hidHandler?.ProcessInput(ref message);
            }
            return(NativeMethods.DefWindowProc(hWnd, msg, wParam, lParam));
        }
Exemple #5
0
        public bool PreFilterMessage(ref Message m)
        {
            if (m.Msg == WM_INPUT)
            {
                if (HandleOwnDevices)
                {
                    _handler.ProcessInput(ref m);
                }
                else
                {
                    return(ProcessRawInput(m.LParam));
                }
            }

            return(false);
        }
Exemple #6
0
 /// <summary>
 /// Hook in HID handler.
 /// </summary>
 /// <param name="message"></param>
 protected override void WndProc(ref Message message)
 {
     switch (message.Msg)
     {
     //case Const.WM_KEYDOWN:
     //ProcessKeyDown(message.WParam);
     //break;
     case Const.WM_INPUT:
         //Log that message
         richTextBoxLogs.AppendText("WM_INPUT: " + message.ToString() + "\r\n");
         //Returning zero means we processed that message.
         message.Result = new IntPtr(0);
         //iHidHandler.ProcessInput(ref message);
         iHidParser.ProcessInput(ref message);
         break;
     }
     //Is that needed? Check the docs.
     base.WndProc(ref message);
 }