private void TimeSelectionControl_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { TimeController timeController = _timeController; if (timeController != null) { int addend = 1; if (e.Control) { addend = 8; } switch (e.KeyCode) { case Keys.Right: timeController.CurrentIndex += addend; timeController.CursorTime = timeController.CurrentTime; if (e.Shift) { timeController.AdjustSelectedRange(timeController.CurrentTime); } else { timeController.SelectRange(timeController.CurrentTime, timeController.CurrentTime); } e.IsInputKey = true; break; case Keys.Left: timeController.CurrentIndex -= addend; timeController.CursorTime = timeController.CurrentTime; if (e.Shift) { timeController.AdjustSelectedRange(timeController.CurrentTime); } else { timeController.SelectRange(timeController.CurrentTime, timeController.CurrentTime); } e.IsInputKey = true; break; case Keys.Down: this.CurrentTimeTabSize = Math.Min(this.Height / 2, this.CurrentTimeTabSize + addend); e.IsInputKey = true; break; case Keys.Up: this.CurrentTimeTabSize -= addend; e.IsInputKey = true; break; } } }
private void pictDisplay_MouseMove(object sender, MouseEventArgs e) { TimeController timeController = _timeController; if (timeController == null) { return; } decimal cursorTime = getTimeFromPosition(e.X); //cursorTime = Math.Min(timeController.VisibleEndTime, Math.Max(timeController.VisibleBeginTime, cursorTime)); timeController.CursorTime = cursorTime; RegulatedMouseInfo info = _mouse.MouseMove(e); decimal timeDelta = getTimeSpanFromDelta(_mouse.MoveDelta.X); switch (info.Button) { case RegulatedMouseButton.Left: timeController.CursorTime = cursorTime; timeController.SelectRange(Math.Min(cursorTime, _selectingTime), Math.Max(cursorTime, _selectingTime)); break; case RegulatedMouseButton.CtrlLeft: timeController.CurrentTime = cursorTime; timeController.SelectRange(Math.Min(cursorTime, _selectingTime), Math.Max(cursorTime, _selectingTime)); break; case RegulatedMouseButton.AltLeft: decimal timeOffset = timeDelta; if (!this.IsGlobalTimeLineMode) { timeOffset = -timeOffset; } timeController.SetVisibleTime(timeController.VisibleBeginTime + timeOffset, timeController.VisibleEndTime + timeOffset); break; case RegulatedMouseButton.ShiftLeft: timeController.AdjustSelectedRange(cursorTime); break; case RegulatedMouseButton.ShiftCtrlLeft: timeController.CurrentTime = cursorTime; timeController.AdjustSelectedRange(cursorTime); break; } }
private void pictDisplay_MouseDown(object sender, MouseEventArgs e) { TimeController timeController = _timeController; if (timeController == null) { return; } RegulatedMouseButton button = _mouse.MouseDown(e); decimal cursorTime = getTimeFromPosition(e.X); //cursorTime = Math.Min(timeController.VisibleEndTime, Math.Max(timeController.VisibleBeginTime, cursorTime)); _selectingTime = cursorTime; switch (button) { case RegulatedMouseButton.Left: timeController.CursorTime = cursorTime; timeController.SelectRange(Math.Min(cursorTime, _selectingTime), Math.Max(cursorTime, _selectingTime)); break; case RegulatedMouseButton.CtrlLeft: timeController.CurrentTime = cursorTime; timeController.SelectRange(Math.Min(cursorTime, _selectingTime), Math.Max(cursorTime, _selectingTime)); break; case RegulatedMouseButton.ShiftCtrlLeft: timeController.AdjustSelectedRange(cursorTime); timeController.CurrentTime = cursorTime; break; case RegulatedMouseButton.ShiftLeft: timeController.AdjustSelectedRange(cursorTime); break; } }
private void pictCurrentTab_MouseMove(object sender, MouseEventArgs e) { TimeController timeController = _timeController; if (timeController == null) { return; } if (_leftDownTab && !_rightDownTab) { timeController.CurrentTime = getTimeFromPosition(e.X + pictCurrentTab.Location.X); if ((Control.ModifierKeys & Keys.Shift) != 0) { timeController.AdjustSelectedRange(timeController.CurrentTime); } } }