public void HandleRepeat(InputState state) { // Only drawables that can still handle input should handle the repeat var drawables = ButtonDownInputQueue.Intersect(InputQueue).Where(t => t.IsAlive && t.IsPresent); PropagateButtonEvent(drawables, new KeyDownEvent(state, Button, true)); }
private void handleDragStart(InputState state) { Trace.Assert(DraggedDrawable == null, $"The {nameof(DraggedDrawable)} was not set to null by {nameof(handleDragEnd)}."); Trace.Assert(!DragStarted, $"A {nameof(DraggedDrawable)} was already searched for. Call {nameof(handleDragEnd)} first."); Trace.Assert(MouseDownPosition != null); DragStarted = true; // also the laziness of IEnumerable here var drawables = ButtonDownInputQueue.Where(t => t.IsAlive && t.IsPresent); DraggedDrawable = PropagateButtonEvent(drawables, new DragStartEvent(state, Button, MouseDownPosition)); if (DraggedDrawable != null) { DraggedDrawable.IsDragged = true; } }