Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6939595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:38:34+00:00 2026-05-27T12:38:34+00:00

I am trying to slow down the mouse cursor programmatically by multiplying the mouse

  • 0

I am trying to slow down the mouse cursor programmatically by multiplying the mouse delta by a number between 1 and 0 on every mouse move event. It’s working fine for the X axis, but the Y position always gets moved back to the center of the screen, it’s very bizarre.

I can’t seem to figure out why the Y position of the cursor gets moved towards the center of the screen no matter whether you move the mouse up up or down…

I set up a CGEventTap for mouse move events, and this is the code for the callback:

CGEventRef 
mouse_filter(CGEventTapProxy proxy, CGEventType type, CGEventRef event, float *speed_modifier) {


    CGPoint point = CGEventGetLocation(event);
    NSPoint old_point = [NSEvent mouseLocation];
    CGPoint target; 

    int tX = point.x; 
    int tY = point.y; 
    float oX = old_point.x;
    float oY = old_point.y;
    float dX = tX-oX;
    float dY = tY-oY;


    dX*=0.1, dY*=0.1;
    tX = round(oX + dX);
    tY = round(oY + dY);


    target = CGPointMake(tX, tY);

    CGWarpMouseCursorPosition(target);




    return false;
}

Can someone help me figure out how to do this?

I logged some values during the running of the application and discovered that oY does not seem to contain the expected values… it seems to always be close to 430, usually within a couple pixels of that. tY contains the seemingly correct target value, so it stands to reason that oY from one iteration should be equal to tY from the previous one (it works properly for the X values), however, oY is always close to 430, even when the mouse should be moving towards the top of the screen. This makes me think that dY is somehow being set to a value that will bring oY back to around 430, but I can’t figure out how that is happening, as dY seems to output the correct value as well…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:38:34+00:00Added an answer on May 27, 2026 at 12:38 pm

    CGPoint point = CGEventGetLocation(event);
    is a point where (0,0) is the top left of the screen.

    NSPoint old_point = [NSEvent mouseLocation];
    is a point where (0,1) is the bottom left of the screen.

    I if I get the screen height, and do:

    ‘oY = abs(oY – screen_height+1);`, oY is now based off the top Left of the screen, and my application works properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the MPMediaPlayback protocol's currentPlaybackRate() to slow down a video. I'm
I'm trying to send an email async so it doesn't slow down my front
I am trying to gradually slow down a movie clip using Actionscript 3. My
I'm trying to save the mouse Y coordinates to the variable startPosition ONLY every
I'm trying to speed up (or slow down) the Galleria imageslider by button. Is
I am trying to speed my gui that loads very slow slow when I
I am trying to determine why an asp.net grid view is so horribly slow.
EDIT: Updated with suggestions from Bill Karwin below. Still very slow. I'm trying to
I'm trying to set up a pretty basic hover animation in jQuery. Mouse over
I'm trying to make a top-down spaceship game and I want the movement to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.