void FireMouseDown(object sender, SelfTouchEventArgs e) { lock (SyncRoot) { _mouseDownCounter++; //only act after 3 hits if (_mouseDownCounter < NoiseFilter) { return; } _mouseUpCounter = 0; //Prevent int overflow if (_mouseDownCounter > int.MaxValue) { _mouseDownCounter = NoiseFilter; } //Check the time interval if (!CheckEventInterval(ref _mouseDownHit, MouseButtonsIntervalInMilliseconds) || _mouseDown) { return; } _mouseDown = true; WindowMessage = "Mouse down"; if (!_controlMouse) { return; } MouseSimulator.MouseDown(System.Windows.Input.MouseButton.Left); } }
private void GestureSelfTouchDetected(object sender, SelfTouchEventArgs e) { Action del3 = () => lblNaam.Visibility = Visibility.Hidden; Action del4 = () => lblWorkshop.Visibility = Visibility.Hidden; lblNaam.Dispatcher.BeginInvoke(DispatcherPriority.Send, del3); lblWorkshop.Dispatcher.BeginInvoke(DispatcherPriority.Send, del4); RestoreBalls(); }
void FireCustomEvent(object sender, SelfTouchEventArgs e) { lock (SyncRoot) { //Left button down if (!CheckEventInterval(ref _fireCustomHit, MouseButtonsIntervalInMilliseconds)) { return; } WindowMessage = "Fire Custom"; _lefthandRightShoulderGesture.SelfTouchDetected -= FireCustomEvent; DispatcherHelper.CheckBeginInvokeOnUI(InitStartGame); } }
void FireMouseClick(object sender, SelfTouchEventArgs e) { lock (SyncRoot) { //Left button down if (!CheckEventInterval(ref _mouseClickHit, MouseButtonsIntervalInMilliseconds)) { return; } WindowMessage = "Mouse click"; if (!_controlMouse) { return; } MouseSimulator.MouseDown(System.Windows.Input.MouseButton.Left); MouseSimulator.MouseUp(System.Windows.Input.MouseButton.Left); _mouseDown = false; } }
private void SelfTouch(object sender, SelfTouchEventArgs e) { Trace.Write(string.Format("{0} LeftHand on RightShoulder", _counter++)); }