public void Evaluate(int spreadMax) { var binCount = BinSizePin.IOObject.Length; FSubjects.ResizeAndDispose(binCount); KeyboardOut.ResizeAndDismiss(binCount, slice => new Keyboard(FSubjects[slice])); for (int bin = 0; bin < binCount; bin++) { var subject = FSubjects[bin]; var notificationCount = EventTypeIn[bin].SliceCount; for (int i = 0; i < notificationCount; i++) { KeyNotification notification; switch (EventTypeIn[bin][i]) { case KeyNotificationKind.KeyDown: notification = new KeyDownNotification((Keys)KeyCodeIn[bin][i], this); break; case KeyNotificationKind.KeyPress: var s = KeyCharIn[bin][i]; notification = s.Length > 0 ? new KeyPressNotification(s[0], this) : null; break; case KeyNotificationKind.KeyUp: notification = new KeyUpNotification((Keys)KeyCodeIn[bin][i], this); break; case KeyNotificationKind.DeviceLost: notification = new KeyboardLostNotification(this); break; default: throw new NotImplementedException(); } if (notification != null) { subject.OnNext(notification); } } } }
public IMouseKeyboardHandler KeyUp(KeyUpNotification arg) { return(FHandler.KeyUp(arg) ? this : null); }