// initializes and actualizes new instance public static InputInfo Create() { var result = new InputInfo(); result.Update(); return result; }
// initializes and actualizes new instance public static InputInfo Create() { var result = new InputInfo(); result.Update(); return(result); }
// starts user input polling public void Start() { lock (timerLock) { initialInfo.Update(); actualInfo = (InputInfo)initialInfo.Clone(); timer.Start(); } }
protected virtual void Update() { if (!IsActive() || !IsInteractable() || InputBind == null) { return; } InputBind.Update(); _stateTransition(); _downHandle(); _holdHandle(); _clickEventHandle(); _upHandle(false); }
// user input polling private void timer_Elapsed(object sender, ElapsedEventArgs e) { lock (timerLock) { actualInfo.Update(); // compare user input info if (!initialInfo.Equals(actualInfo)) { timer.Stop(); var handler = Changed; if (handler != null) { // fire changed event handler(this, new InputChangedEventArgs { Initial = initialInfo.DateTime, Changed = actualInfo.DateTime }); } } } }