void Interrupt(uint data1, uint data2, TimeSpan time)
            {
                RawButtonActions action = (data2 != 0) ? RawButtonActions.ButtonUp : RawButtonActions.ButtonDown;

                RawButtonInputReport report = new RawButtonInputReport(sink.source, time, button, action);

                // Queue the button press to the input provider site.
                sink.Dispatcher.BeginInvoke(sink.callback, report);
            }
            void Interrupt(Cpu.Pin port, bool state, TimeSpan time)
            {
                RawButtonActions action = state ? RawButtonActions.ButtonUp : RawButtonActions.ButtonDown;

                RawButtonInputReport report = new RawButtonInputReport(sink.source, time, button, action);

                // Queue the button press to the input provider site.
                sink.Dispatcher.BeginInvoke(sink.callback, report);
            }
            private void Pin_ValueChanged(object sender, GpioPinValueChangedEventArgs e)
            {
                RawButtonActions action = (e.Edge == GpioPinEdge.FallingEdge) ? RawButtonActions.ButtonUp : RawButtonActions.ButtonDown;

                DateTime             time   = DateTime.UtcNow;
                RawButtonInputReport report = new RawButtonInputReport(sink.source, time, button, action);

                // Queue the button press to the input provider site.
                sink.Dispatcher.BeginInvoke(sink.callback, new InputReportArgs(buttonDevice, report));
            }
            void Interrupt(uint data1, uint data2, DateTime time)
            {
                // queue the button press to the input provider site.
                RawButtonActions action = (data2 != 0) ?
                                          RawButtonActions.ButtonUp : RawButtonActions.ButtonDown;

                RawButtonInputReport report =
                    new RawButtonInputReport(_sink._source, time, _button, action);

                _sink.Dispatcher.BeginInvoke(_sink._callback, new InputReportArgs(_buttonDevice, report));
            }
Beispiel #5
0
        private static void GPIOButtonInputProvider_ButtonInput(InputReportArgs arg)
        {
            InputReportArgs      args   = (InputReportArgs)arg;
            RawButtonInputReport report = (RawButtonInputReport)args.Report;
            string info = report.Timestamp.ToLocalTime().ToString("HH:mm:ss.fff") +
                          " Button=" + report.Button.ToString() +
                          " Action=" + report.Actions.ToString();

            Debug.Print(info);
            Display.WriteLine(info);
        }
            private void Pin_ValueChanged(object sender, PinValueChangedEventArgs e)
            {
                RawButtonActions action = (e.ChangeType == PinEventTypes.Falling) ? RawButtonActions.ButtonUp : RawButtonActions.ButtonDown;

                // Create a time, should be from the pin_ValueChanged event.
                DateTime time = DateTime.UtcNow;

                RawButtonInputReport report = new RawButtonInputReport(sink.source, time, button, action);

                // Queue the button press to the input provider site.
                sink.Dispatcher.BeginInvoke(sink.callback, new InputReportArgs(buttonDevice, report));
            }
Beispiel #7
0
            void Interrupt(uint data1, uint data2, DateTime time)
            {
                RawButtonActions     action = (data2 != 0) ? RawButtonActions.ButtonUp : RawButtonActions.ButtonDown;
                RawButtonInputReport report = new RawButtonInputReport(null, time, m_button, action);

                // Queue the button press to the handler.
                m_sink.m_dispatcher.BeginInvoke(delegate(object arg)
                {
                    m_sink.m_buttonInputHandler((InputReportArgs)arg);
                    return(null);
                },
                                                new InputReportArgs(m_buttonDevice, report));
            }
Beispiel #8
0
 /// <summary>
 /// Data received handler.
 /// Fires WPF button pressed evet according to command received
 /// </summary>
 private void controller_DataReceived(TVRemoteReceiver sender, int command, int address)
 {
     for (int i = 0; i < buttons.Length; i++)
     {
         if (command == buttons[i].Command && (deviceAddress == -1 || deviceAddress == address))
         {
             RawButtonInputReport report = new RawButtonInputReport(source, new TimeSpan(DateTime.Now.Ticks), buttons[i].Button, ButtonAction);
             // Queue the button press to the input provider site.
             Dispatcher.BeginInvoke(callback, report);
             break;
         }
     }
 }
            void Interrupt(uint data1, uint data2, DateTime time)
#endif
            {
                RawButtonActions action = (data2 != 0) ?
                                          RawButtonActions.ButtonUp : RawButtonActions.ButtonDown;

                RawButtonInputReport report = new RawButtonInputReport(
                    sink.source, time, button, action);

                // Queue the button press to the input provider site.
#if MF_FRAMEWORK_VERSION_V3_0
                sink.Dispatcher.BeginInvoke(sink.callback, report);
#else
                sink.Dispatcher.BeginInvoke(sink.callback, new InputReportArgs(buttonDevice, report));
#endif
            }
 private void HandleTouch(RawButtonActions action, TouchScreenEventArgs eventArgs)
 {
     dispatcher.Invoke(
         new TimeSpan(0, 0, 3),
         delegate(object arg)
     {
         Button button = (Button)eventArgs.Target;
         RawButtonInputReport report = new RawButtonInputReport(this.presentationSource, eventArgs.TimeStamp, button, action);
         bool handled = site.ReportInput(this.buttonDevice, report);
         if (!handled)
         {
             ButtonEventArgs buttonEventArgs = new ButtonEventArgs(this.buttonDevice, this.presentationSource, eventArgs.TimeStamp, button);
             this.OnButtonUp(buttonEventArgs);
         }
         return(null);
     },
         null);
 }
Beispiel #11
0
        void ReportInput(DateTime TimeStamp, Button TheButton, RawButtonActions Actions)
        {
            RawButtonInputReport report = new RawButtonInputReport(this.PresentationSource, TimeStamp, TheButton, Actions);

            this.Dispatcher.BeginInvoke(this.ReportInputFunc, new object[] { report });
        }