View.Mouse.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. using System.ComponentModel;
  2. namespace Terminal.Gui.ViewBase;
  3. public partial class View // Mouse APIs
  4. {
  5. /// <summary>
  6. /// Handles <see cref="WantContinuousButtonPressed"/>, we have detected a button
  7. /// down in the view and have grabbed the mouse.
  8. /// </summary>
  9. public IMouseHeldDown? MouseHeldDown { get; set; }
  10. /// <summary>Gets the mouse bindings for this view.</summary>
  11. public MouseBindings MouseBindings { get; internal set; } = null!;
  12. private void SetupMouse ()
  13. {
  14. MouseHeldDown = new MouseHeldDown (this, App?.TimedEvents, App?.Mouse);
  15. MouseBindings = new ();
  16. // TODO: Should the default really work with any button or just button1?
  17. MouseBindings.Add (MouseFlags.Button1Clicked, Command.Select);
  18. MouseBindings.Add (MouseFlags.Button2Clicked, Command.Select);
  19. MouseBindings.Add (MouseFlags.Button3Clicked, Command.Select);
  20. MouseBindings.Add (MouseFlags.Button4Clicked, Command.Select);
  21. MouseBindings.Add (MouseFlags.Button1Clicked | MouseFlags.ButtonCtrl, Command.Select);
  22. }
  23. /// <summary>
  24. /// Invokes the Commands bound to the MouseFlags specified by <paramref name="mouseEventArgs"/>.
  25. /// <para>See <see href="../docs/mouse.md">for an overview of Terminal.Gui mouse APIs.</see></para>
  26. /// </summary>
  27. /// <param name="mouseEventArgs">The mouse event passed.</param>
  28. /// <returns>
  29. /// <see langword="null"/> if no command was invoked; input processing should continue.
  30. /// <see langword="false"/> if at least one command was invoked and was not handled (or cancelled); input processing
  31. /// should continue.
  32. /// <see langword="true"/> if at least one command was invoked and handled (or cancelled); input processing should
  33. /// stop.
  34. /// </returns>
  35. protected bool? InvokeCommandsBoundToMouse (MouseEventArgs mouseEventArgs)
  36. {
  37. if (!MouseBindings.TryGet (mouseEventArgs.Flags, out MouseBinding binding))
  38. {
  39. return null;
  40. }
  41. binding.MouseEventArgs = mouseEventArgs;
  42. return InvokeCommands (binding.Commands, binding);
  43. }
  44. #region MouseEnterLeave
  45. /// <summary>
  46. /// INTERNAL Called by <see cref="IMouse.RaiseMouseEvent"/> when the mouse moves over the View's
  47. /// <see cref="Frame"/>.
  48. /// <see cref="MouseLeave"/> will
  49. /// be raised when the mouse is no longer over the <see cref="Frame"/>. If another View occludes this View, the
  50. /// that View will also receive MouseEnter/Leave events.
  51. /// </summary>
  52. /// <param name="eventArgs"></param>
  53. /// <returns>
  54. /// <see langword="true"/> if the event was canceled, <see langword="false"/> if not, <see langword="null"/> if the
  55. /// view is not visible. Cancelling the event
  56. /// prevents Views higher in the visible hierarchy from receiving Enter/Leave events.
  57. /// </returns>
  58. internal bool? NewMouseEnterEvent (CancelEventArgs eventArgs)
  59. {
  60. // Pre-conditions
  61. if (!CanBeVisible (this))
  62. {
  63. return null;
  64. }
  65. // Cancellable event
  66. if (OnMouseEnter (eventArgs))
  67. {
  68. return true;
  69. }
  70. MouseEnter?.Invoke (this, eventArgs);
  71. if (eventArgs.Cancel)
  72. {
  73. return true;
  74. }
  75. MouseState |= MouseState.In;
  76. if (HighlightStates != MouseState.None)
  77. {
  78. SetNeedsDraw ();
  79. }
  80. return false;
  81. }
  82. /// <summary>
  83. /// Called when the mouse moves over the View's <see cref="Frame"/> and no other non-SubView occludes it.
  84. /// <see cref="MouseLeave"/> will
  85. /// be raised when the mouse is no longer over the <see cref="Frame"/>.
  86. /// </summary>
  87. /// <remarks>
  88. /// <para>
  89. /// A view must be visible to receive Enter events (Leave events are always received).
  90. /// </para>
  91. /// <para>
  92. /// If the event is cancelled, the mouse event will not be propagated to other views and <see cref="MouseEnter"/>
  93. /// will not be raised.
  94. /// </para>
  95. /// <para>
  96. /// Adornments receive MouseEnter/Leave events when the mouse is over the Adornment's <see cref="Thickness"/>.
  97. /// </para>
  98. /// <para>
  99. /// See <see cref="MouseState"/> for more information.
  100. /// </para>
  101. /// </remarks>
  102. /// <param name="eventArgs"></param>
  103. /// <returns>
  104. /// <see langword="true"/> if the event was canceled, <see langword="false"/> if not. Cancelling the event
  105. /// prevents Views higher in the visible hierarchy from receiving Enter/Leave events.
  106. /// </returns>
  107. protected virtual bool OnMouseEnter (CancelEventArgs eventArgs) { return false; }
  108. /// <summary>
  109. /// Raised when the mouse moves over the View's <see cref="Frame"/>. <see cref="MouseLeave"/> will
  110. /// be raised when the mouse is no longer over the <see cref="Frame"/>. If another View occludes this View, the
  111. /// that View will also receive MouseEnter/Leave events.
  112. /// </summary>
  113. /// <remarks>
  114. /// <para>
  115. /// A view must be visible to receive Enter events (Leave events are always received).
  116. /// </para>
  117. /// <para>
  118. /// If the event is cancelled, the mouse event will not be propagated to other views.
  119. /// </para>
  120. /// <para>
  121. /// Adornments receive MouseEnter/Leave events when the mouse is over the Adornment's <see cref="Thickness"/>.
  122. /// </para>
  123. /// <para>
  124. /// Set <see cref="CancelEventArgs.Cancel"/> to <see langword="true"/> if the event was canceled,
  125. /// <see langword="false"/> if not. Cancelling the event
  126. /// prevents Views higher in the visible hierarchy from receiving Enter/Leave events.
  127. /// </para>
  128. /// <para>
  129. /// See <see cref="MouseState"/> for more information.
  130. /// </para>
  131. /// </remarks>
  132. public event EventHandler<CancelEventArgs>? MouseEnter;
  133. /// <summary>
  134. /// INTERNAL Called by <see cref="IMouse.RaiseMouseEvent"/> when the mouse leaves <see cref="Frame"/>, or is
  135. /// occluded
  136. /// by another non-SubView.
  137. /// </summary>
  138. /// <remarks>
  139. /// <para>
  140. /// This method calls <see cref="OnMouseLeave"/> and raises the <see cref="MouseLeave"/> event.
  141. /// </para>
  142. /// <para>
  143. /// Adornments receive MouseEnter/Leave events when the mouse is over the Adornment's <see cref="Thickness"/>.
  144. /// </para>
  145. /// <para>
  146. /// See <see cref="MouseState"/> for more information.
  147. /// </para>
  148. /// </remarks>
  149. internal void NewMouseLeaveEvent ()
  150. {
  151. // Pre-conditions
  152. // Non-cancellable event
  153. OnMouseLeave ();
  154. MouseLeave?.Invoke (this, EventArgs.Empty);
  155. MouseState &= ~MouseState.In;
  156. // TODO: Should we also MouseState &= ~MouseState.Pressed; ??
  157. if (HighlightStates != MouseState.None)
  158. {
  159. SetNeedsDraw ();
  160. }
  161. }
  162. /// <summary>
  163. /// Called when the mouse moves outside View's <see cref="Frame"/>, or is occluded by another non-SubView.
  164. /// </summary>
  165. /// <remarks>
  166. /// <para>
  167. /// Adornments receive MouseEnter/Leave events when the mouse is over the Adornment's <see cref="Thickness"/>.
  168. /// </para>
  169. /// <para>
  170. /// See <see cref="MouseState"/> for more information.
  171. /// </para>
  172. /// </remarks>
  173. protected virtual void OnMouseLeave () { }
  174. /// <summary>
  175. /// Raised when the mouse moves outside View's <see cref="Frame"/>, or is occluded by another non-SubView.
  176. /// </summary>
  177. /// <remarks>
  178. /// <para>
  179. /// Adornments receive MouseEnter/Leave events when the mouse is over the Adornment's <see cref="Thickness"/>.
  180. /// </para>
  181. /// <para>
  182. /// See <see cref="MouseState"/> for more information.
  183. /// </para>
  184. /// </remarks>
  185. public event EventHandler? MouseLeave;
  186. #endregion MouseEnterLeave
  187. #region Low Level Mouse Events
  188. /// <summary>
  189. /// Gets or sets whether the <see cref="View"/> wants continuous button pressed events. When set to
  190. /// <see langword="true"/>,
  191. /// and the user presses and holds the mouse button, <see cref="NewMouseEvent"/> will be
  192. /// repeatedly called with the same <see cref="MouseFlags"/> for as long as the mouse button remains pressed.
  193. /// </summary>
  194. public bool WantContinuousButtonPressed { get; set; }
  195. /// <summary>Gets or sets whether the <see cref="View"/> wants mouse position reports.</summary>
  196. /// <value><see langword="true"/> if mouse position reports are wanted; otherwise, <see langword="false"/>.</value>
  197. public bool WantMousePositionReports { get; set; }
  198. /// <summary>
  199. /// Processes a new <see cref="MouseEvent"/>. This method is called by <see cref="IMouse.RaiseMouseEvent"/> when a
  200. /// mouse
  201. /// event occurs.
  202. /// </summary>
  203. /// <remarks>
  204. /// <para>
  205. /// A view must be both enabled and visible to receive mouse events.
  206. /// </para>
  207. /// <para>
  208. /// If <see cref="WantContinuousButtonPressed"/> is <see langword="true"/>, and the user presses and holds the
  209. /// mouse button, <see cref="NewMouseEvent"/> will be repeatedly called with the same <see cref="MouseFlags"/> for
  210. /// as long as the mouse button remains pressed.
  211. /// </para>
  212. /// </remarks>
  213. /// <param name="mouseEvent"></param>
  214. /// <returns><see langword="true"/> if the event was handled, <see langword="false"/> otherwise.</returns>
  215. public bool? NewMouseEvent (MouseEventArgs mouseEvent)
  216. {
  217. // Pre-conditions
  218. if (!Enabled)
  219. {
  220. // A disabled view should not eat mouse events
  221. return false;
  222. }
  223. if (!CanBeVisible (this))
  224. {
  225. return false;
  226. }
  227. if (!WantMousePositionReports && mouseEvent.Flags == MouseFlags.ReportMousePosition)
  228. {
  229. return false;
  230. }
  231. // Cancellable event
  232. if (RaiseMouseEvent (mouseEvent) || mouseEvent.Handled)
  233. {
  234. return true;
  235. }
  236. // Post-Conditions
  237. if (HighlightStates != MouseState.None || WantContinuousButtonPressed)
  238. {
  239. if (WhenGrabbedHandlePressed (mouseEvent))
  240. {
  241. return mouseEvent.Handled;
  242. }
  243. if (WhenGrabbedHandleReleased (mouseEvent))
  244. {
  245. return mouseEvent.Handled;
  246. }
  247. if (WhenGrabbedHandleClicked (mouseEvent))
  248. {
  249. return mouseEvent.Handled;
  250. }
  251. }
  252. if (mouseEvent.IsWheel)
  253. {
  254. return RaiseMouseWheelEvent (mouseEvent);
  255. }
  256. return false;
  257. }
  258. /// <summary>
  259. /// Raises the <see cref="RaiseMouseEvent"/>/<see cref="MouseEvent"/> event.
  260. /// </summary>
  261. /// <param name="mouseEvent"></param>
  262. /// <returns><see langword="true"/>, if the event was handled, <see langword="false"/> otherwise.</returns>
  263. public bool RaiseMouseEvent (MouseEventArgs mouseEvent)
  264. {
  265. // TODO: probably this should be moved elsewhere, please advise
  266. if (WantContinuousButtonPressed && MouseHeldDown != null)
  267. {
  268. if (mouseEvent.IsPressed)
  269. {
  270. MouseHeldDown.Start ();
  271. }
  272. else
  273. {
  274. MouseHeldDown.Stop ();
  275. }
  276. }
  277. if (OnMouseEvent (mouseEvent) || mouseEvent.Handled)
  278. {
  279. return true;
  280. }
  281. MouseEvent?.Invoke (this, mouseEvent);
  282. if (!mouseEvent.Handled)
  283. {
  284. mouseEvent.Handled = InvokeCommandsBoundToMouse (mouseEvent) == true;
  285. }
  286. return mouseEvent.Handled;
  287. }
  288. /// <summary>Called when a mouse event occurs within the view's <see cref="Viewport"/>.</summary>
  289. /// <remarks>
  290. /// <para>
  291. /// The coordinates are relative to <see cref="View.Viewport"/>.
  292. /// </para>
  293. /// </remarks>
  294. /// <param name="mouseEvent"></param>
  295. /// <returns><see langword="true"/>, if the event was handled, <see langword="false"/> otherwise.</returns>
  296. protected virtual bool OnMouseEvent (MouseEventArgs mouseEvent) { return false; }
  297. /// <summary>Raised when a mouse event occurs.</summary>
  298. /// <remarks>
  299. /// <para>
  300. /// The coordinates are relative to <see cref="View.Viewport"/>.
  301. /// </para>
  302. /// </remarks>
  303. public event EventHandler<MouseEventArgs>? MouseEvent;
  304. #endregion Low Level Mouse Events
  305. #region WhenGrabbed Handlers
  306. /// <summary>
  307. /// INTERNAL For cases where the view is grabbed and the mouse is clicked, this method handles the released event
  308. /// (typically
  309. /// when <see cref="WantContinuousButtonPressed"/> or <see cref="HighlightStates"/> are set).
  310. /// </summary>
  311. /// <remarks>
  312. /// Marked internal just to support unit tests
  313. /// </remarks>
  314. /// <param name="mouseEvent"></param>
  315. /// <returns><see langword="true"/>, if the event was handled, <see langword="false"/> otherwise.</returns>
  316. internal bool WhenGrabbedHandleReleased (MouseEventArgs mouseEvent)
  317. {
  318. mouseEvent.Handled = false;
  319. if (mouseEvent.IsReleased)
  320. {
  321. if (App?.Mouse.MouseGrabView == this)
  322. {
  323. //Logging.Debug ($"{Id} - {MouseState}");
  324. MouseState &= ~MouseState.Pressed;
  325. MouseState &= ~MouseState.PressedOutside;
  326. }
  327. return mouseEvent.Handled = true;
  328. }
  329. return false;
  330. }
  331. /// <summary>
  332. /// INTERNAL For cases where the view is grabbed and the mouse is clicked, this method handles the released event
  333. /// (typically
  334. /// when <see cref="WantContinuousButtonPressed"/> or <see cref="HighlightStates"/> are set).
  335. /// </summary>
  336. /// <remarks>
  337. /// <para>
  338. /// Marked internal just to support unit tests
  339. /// </para>
  340. /// </remarks>
  341. /// <param name="mouseEvent"></param>
  342. /// <returns><see langword="true"/>, if the event was handled, <see langword="false"/> otherwise.</returns>
  343. private bool WhenGrabbedHandlePressed (MouseEventArgs mouseEvent)
  344. {
  345. mouseEvent.Handled = false;
  346. if (mouseEvent.IsPressed)
  347. {
  348. // The first time we get pressed event, grab the mouse and set focus
  349. if (App?.Mouse.MouseGrabView != this)
  350. {
  351. App?.Mouse.GrabMouse (this);
  352. if (!HasFocus && CanFocus)
  353. {
  354. // Set the focus, but don't invoke Accept
  355. SetFocus ();
  356. }
  357. mouseEvent.Handled = true;
  358. }
  359. if (Viewport.Contains (mouseEvent.Position))
  360. {
  361. //Logging.Debug ($"{Id} - Inside Viewport: {MouseState}");
  362. // The mouse is inside.
  363. if (HighlightStates.HasFlag (MouseState.Pressed))
  364. {
  365. MouseState |= MouseState.Pressed;
  366. }
  367. // Always clear PressedOutside when the mouse is pressed inside the Viewport
  368. MouseState &= ~MouseState.PressedOutside;
  369. }
  370. if (!Viewport.Contains (mouseEvent.Position))
  371. {
  372. // Logging.Debug ($"{Id} - Outside Viewport: {MouseState}");
  373. // The mouse is outside.
  374. // When WantContinuousButtonPressed is set we want to keep the mouse state as pressed (e.g. a repeating button).
  375. // This shows the user that the button is doing something, even if the mouse is outside the Viewport.
  376. if (HighlightStates.HasFlag (MouseState.PressedOutside) && !WantContinuousButtonPressed)
  377. {
  378. MouseState |= MouseState.PressedOutside;
  379. }
  380. }
  381. return mouseEvent.Handled = true;
  382. }
  383. return false;
  384. }
  385. /// <summary>
  386. /// INTERNAL For cases where the view is grabbed and the mouse is clicked, this method handles the click event
  387. /// (typically
  388. /// when <see cref="WantContinuousButtonPressed"/> or <see cref="HighlightStates"/> are set).
  389. /// </summary>
  390. /// <remarks>
  391. /// Marked internal just to support unit tests
  392. /// </remarks>
  393. /// <param name="mouseEvent"></param>
  394. /// <returns><see langword="true"/>, if the event was handled, <see langword="false"/> otherwise.</returns>
  395. internal bool WhenGrabbedHandleClicked (MouseEventArgs mouseEvent)
  396. {
  397. mouseEvent.Handled = false;
  398. if (App?.Mouse.MouseGrabView == this && mouseEvent.IsSingleClicked)
  399. {
  400. // We're grabbed. Clicked event comes after the last Release. This is our signal to ungrab
  401. App?.Mouse.UngrabMouse ();
  402. // TODO: Prove we need to unset MouseState.Pressed and MouseState.PressedOutside here
  403. // TODO: There may be perf gains if we don't unset these flags here
  404. MouseState &= ~MouseState.Pressed;
  405. MouseState &= ~MouseState.PressedOutside;
  406. // If mouse is still in bounds, generate a click
  407. if (!WantMousePositionReports && Viewport.Contains (mouseEvent.Position))
  408. {
  409. // By default, this will raise Selecting/OnSelecting - Subclasses can override this via AddCommand (Command.Select ...).
  410. mouseEvent.Handled = InvokeCommandsBoundToMouse (mouseEvent) == true;
  411. }
  412. return mouseEvent.Handled = true;
  413. }
  414. return false;
  415. }
  416. #endregion WhenGrabbed Handlers
  417. #region Mouse Wheel Events
  418. /// <summary>Raises the <see cref="OnMouseWheel"/>/<see cref="MouseWheel"/> event.</summary>
  419. /// <remarks>
  420. /// </remarks>
  421. /// <returns><see langword="true"/>, if the event was handled, <see langword="false"/> otherwise.</returns>
  422. protected bool RaiseMouseWheelEvent (MouseEventArgs args)
  423. {
  424. // Pre-conditions
  425. if (!Enabled)
  426. {
  427. // QUESTION: Is this right? Should a disabled view eat mouse?
  428. return args.Handled = false;
  429. }
  430. // Cancellable event
  431. if (OnMouseWheel (args) || args.Handled)
  432. {
  433. return args.Handled;
  434. }
  435. MouseWheel?.Invoke (this, args);
  436. if (args.Handled)
  437. {
  438. return true;
  439. }
  440. args.Handled = InvokeCommandsBoundToMouse (args) == true;
  441. return args.Handled;
  442. }
  443. /// <summary>
  444. /// Called when a mouse wheel event occurs. Check <see cref="MouseEventArgs.Flags"/> to see which wheel was moved was
  445. /// clicked.
  446. /// </summary>
  447. /// <remarks>
  448. /// </remarks>
  449. /// <param name="args"></param>
  450. /// <returns><see langword="true"/>, if the event was handled, <see langword="false"/> otherwise.</returns>
  451. protected virtual bool OnMouseWheel (MouseEventArgs args) { return false; }
  452. /// <summary>Raised when a mouse wheel event occurs.</summary>
  453. /// <remarks>
  454. /// </remarks>
  455. public event EventHandler<MouseEventArgs>? MouseWheel;
  456. #endregion Mouse Wheel Events
  457. #region MouseState Handling
  458. private MouseState _mouseState;
  459. /// <summary>
  460. /// Gets the state of the mouse relative to the View. When changed, the <see cref="MouseStateChanged"/>/
  461. /// <see cref="OnMouseStateChanged"/>
  462. /// event will be raised.
  463. /// </summary>
  464. public MouseState MouseState
  465. {
  466. get => _mouseState;
  467. internal set
  468. {
  469. if (_mouseState == value)
  470. {
  471. return;
  472. }
  473. EventArgs<MouseState> args = new (value);
  474. RaiseMouseStateChanged (args);
  475. _mouseState = value;
  476. }
  477. }
  478. /// <summary>
  479. /// Gets or sets which <see cref="MouseState"/> changes should cause the View to change its appearance.
  480. /// </summary>
  481. /// <remarks>
  482. /// <para>
  483. /// <see cref="MouseState.In"/> is set by default, which means the View will be highlighted when the
  484. /// mouse is over it. The default behavior of <see cref="SetAttributeForRole"/>
  485. /// is to use the <see cref="Drawing.VisualRole.Highlight"/> role for the highlight Attribute.
  486. /// </para>
  487. /// <para>
  488. /// <see cref="MouseState.Pressed"/> means the View will be highlighted when the mouse is pressed over it.
  489. /// <see cref="Border"/>'s default behavior is to use
  490. /// the <see cref="VisualRole.Highlight"/> role when the Border is pressed for Arrangement.
  491. /// <see cref="Margin"/>'s default behavior, when shadows are enabled, is to move the shadow providing
  492. /// a pressed effect.
  493. /// </para>
  494. /// <para>
  495. /// <see cref="MouseState.PressedOutside"/> means the View will be highlighted when the mouse was pressed
  496. /// inside it and then moved outside of it, unless <see cref="WantContinuousButtonPressed"/> is set to
  497. /// <see langword="true"/>, in which case the flag has no effect.
  498. /// </para>
  499. /// </remarks>
  500. public MouseState HighlightStates { get; set; }
  501. /// <summary>
  502. /// INTERNAL Raises the <see cref="MouseStateChanged"/> event.
  503. /// </summary>
  504. /// <param name="args"></param>
  505. private void RaiseMouseStateChanged (EventArgs<MouseState> args)
  506. {
  507. //Logging.Debug ($"{Id} - {args.Value} -> {args.Value}");
  508. OnMouseStateChanged (args);
  509. MouseStateChanged?.Invoke (this, args);
  510. }
  511. /// <summary>
  512. /// Called when <see cref="MouseState"/> has changed, indicating the View should be highlighted or not. The <see cref="MouseState"/> passed in the event
  513. /// indicates the highlight style that will be applied.
  514. /// </summary>
  515. protected virtual void OnMouseStateChanged (EventArgs<MouseState> args) { }
  516. /// <summary>
  517. /// RaisedCalled when <see cref="MouseState"/> has changed, indicating the View should be highlighted or not. The <see cref="MouseState"/> passed in the event
  518. /// indicates the highlight style that will be applied.
  519. /// </summary>
  520. public event EventHandler<EventArgs<MouseState>>? MouseStateChanged;
  521. #endregion MouseState Handling
  522. private void DisposeMouse () { }
  523. }