private IEnumerator TestButton(Antilatency.HardwareExtensionInterface.IInputPin inputPin) { while (_aheiCotask != null) { yield return(new WaitForSeconds(0.001f)); var inputValue = inputPin.getState(); if (inputValue == Antilatency.HardwareExtensionInterface.Interop.PinState.Low) { OnButtonReleased.Invoke(); if (_playing == true) { OnButtonReleased.Invoke(); _playing = false; } } else { if (_playing == false) { OnButtonPressed.Invoke(); _playing = true; } } } }
void Update() { if (Input.GetMouseButtonDown(0)) { OnPress.Invoke(true); } if (Input.GetMouseButtonUp(0)) { OnPress.Invoke(false); } }
void Update() { if (isPointerDown && !longPressed) { if (Time.time - timePressStarted > holdTime) { longPressed = true; onPress.Invoke(true); #if UI_DEBUG Debug.LogError("OnLongPress:" + this.gameObject); #endif } } }
// Check if this binding has been activated, and if so, dispatch events and change state public override void Update(GameTime gameTime) { // Update State (pressed if any of the keys is pressed bool oldPressed = isPressed; reset(); // Update the state based on the keyboard // Invoke state change events if (downEvent != null && isPressed && !oldPressed) { downEvent.Invoke(); } else { if (upEvent != null && !isPressed && oldPressed) { upEvent.Invoke(); } } }
public void Play() { OnPress.Invoke(); }
public void OnPress(Android.Views.Keycode primaryCode) { PressEvent?.Invoke(primaryCode); }