void INotifyDelegate.OnButtonRelease(string deviceId, string buttonName, float pressTime) { if (buttonEventDict.ContainsKey(deviceId)) { var button = new DeviceButton { button = buttonName.ToButtonType(), pressTime = pressTime }; context?.Post(_ => { buttonEventDict[deviceId].NotifyButtonRelease(button); }, null); } }
void INotifyDelegate.OnButtonPush(string deviceId, string buttonName) { if (buttonEventDict.ContainsKey(deviceId)) { var button = new DeviceButton { button = buttonName, pressTime = 0.0F }; context?.Post(_ => { buttonEventDict[deviceId].NotifyButtonPush(button); }, null); } }
void IButtonEventDelegate.NotifyButtonRelease(DeviceButton button) { ButtonReleaseEvent?.Invoke(button); }
void IButtonEventDelegate.NotifyButtonPush(DeviceButton button) { ButtonPushEvent?.Invoke(button); }