Recent

Author Topic: Any way to raise resolution of MouseMove?  (Read 637 times)

741

  • New Member
  • *
  • Posts: 27
Any way to raise resolution of MouseMove?
« on: August 02, 2025, 01:16:45 pm »
I have a grid of squares drawn on a canvas. It is a fairly coarse grid: On my monitor the 16x16 grid occupies about 1/8 screen area.

Even so, moving the mouse at anything above 'slow' means some squares of the grid are 'passed over' by the cursor but no MouseMove event occurs.

I appreciate that having a blizzard of very fine-resolutiion events could clog things up.

Is there a way to tune the mouse reporting interval or similar? Then I could experiment to find a good compromise for my application.

jamie

  • Hero Member
  • *****
  • Posts: 7774
Re: Any way to raise resolution of MouseMove?
« Reply #1 on: August 02, 2025, 04:16:27 pm »
I am going to say NO.

Mouse moves are messaged pumped and there for they need to stand in line with the others in the que.

Also the OS needs to time share.

Depending on your needs you can do this.

Whenever a mouse move is detected, you can log each position to be compared to the next position and from that you can calculate the angle at which the mouse is moving and determine what square the plotted line is intersecting using some trig math.
 
 So, monitoring a specific key being held down to determine a drag operation for example.

Jamie

The only true wisdom is knowing you know nothing

741

  • New Member
  • *
  • Posts: 27
Re: Any way to raise resolution of MouseMove?
« Reply #2 on: August 02, 2025, 09:53:45 pm »
OK - I now realise that my own code must be slowing it down.

I tried simply colouring a pixel, and that has fast enough response.
Code: Pascal  [Select][+][-]
  1. pbxGrid.Canvas.Pixels[X, Y] := clRed;

One thing is I think I'm tripping a repaint on each move. This is kind of necessary as ultimately the grid is showing contours in reponse to user input, and the effect of a new 'spot height' may be widespread.

 

TinyPortal © 2005-2018