Improve mouse interactions in controls
See original GitHub issueTasks
This section was added by @swharden
- trigger mouse enter and leave events in user controls (#1040)
- provide options for automatic axis limits to ignore axis lines and spans (#1083)
- implement an axis crosshair label feature (#1093)
Original Question
Your Environment
- ScottPlot Version: 4.1.12 beta
- Operating System: Win10 20H2
- Is it a GUI app? What platform? WinForms
- .Net:
net472
andnet5.0-windows
was checked.
Simple Mdi Winforms app. Child form with only formsPlot1 on it. MouseLeave
and MouseEnter
not working, MouseMove
is working.
This is critical to implement some info on MouseMove
(to hide it after we leave the plot).
P.s. Related question:
How to properly implement axes cursor on MouseMove
with ScottPlot?
I was tring something like this:
private void formsPlot1_MouseMove(object sender, MouseEventArgs e)
{
(double x, double y) = formsPlot1.GetMouseCoordinates();
_HLine.Y = y;
_HLine.IsVisible = true;
_VLine.X = x;
_VLine.IsVisible = true;
formsPlot1.Render(skipIfCurrentlyRendering: true);
}
And it’s worked BUT. Because of _HLine
and _VLine
are plots, ScottPlot autozoom and autoaxes always trying to consider their values. And this lead to whole wrong behavior. For example:
Cursors must be completely excluded from plotting logic.
Also, is it possible to display Cursor coordinates on the axes (red circles on screen above)?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to Improve Mouse Control and Find Your Sens - YouTube
In this video, I explain settings and techniques to instantly improve your mouse control, and ways to practice mouse control.
Read more >Make your mouse, keyboard, and other input devices ...
Control your mouse with a numeric keypad · To go to the Accessibility settings on your computer, press the Windows logo key+U or...
Read more >How to improve mouse control : r/summonerschool
How to improve mouse control · Make sure you have a good mouse and mousepad · Play games like Osu or something similar...
Read more >How can I increase the performance of Windows mouse ...
Three basic options to increase mouse control: 1. Adjust the Mouse Sensitivity and/or Dwell time in Advanced Settings. 2. Make the mouse cursor...
Read more >Improved mouse control for users with disabilities
Novel software makes fine control of a mouse much easier for users with motor control problems.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
MouseEnter and MouseLeave
These probably are worth forwarding. I’ll try to implement these in the next few days, with a demo. Hiding the crosshairs when the mouse exits the plot seems like a good demo.
Keep in mind that for extreme custom mouse interaction is probably just for the programmer to make their own control and implement the features they want. The controls aren’t very complicated, and it’s much easier to start with the source code and modify it to meet your needs than to try to adapt the standard controls to meet every use case. https://github.com/ScottPlot/ScottPlot/blob/master/src/controls/ScottPlot.WinForms/FormsPlot.cs
Option to ignore axis lines when calling AxisAuto()
The video demonstrates this problem well. Thanks for sharing it! As @StendProg pointed out this question has been raised before. I can add a public field to axis lines so they are ignored when axis limits are determined automatically, which may be a simpler solution.
Labeling crosshair coordinates on the axes
Right now this is not possible, but it should be easy to create a special plot type that does this. I’ll put this idea on the triage list (#1028). This type of behavior would be especially useful for financial charts, similar to https://www.tradingview.com/chart
It should be replaced with
base.OnPointerMoved(e)
and uncommented. I did that in #1040