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 6629613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:17:08+00:00 2026-05-25T22:17:08+00:00

To put this question succinctly, is there any way to offer a real-time web

  • 0

To put this question succinctly, is there any way to offer a real-time web application that requires processing to be done at every coordinate that a user moves their mouse to without dropping any mouse events?

With JS, if we want to keep track of the user’s mouse location, we’re essentially limited to attaching a mousemove handler to some element. Unfortunately, if we’re using the mouse location to perform some expensive procedures such as drawing dynamic graphics to the screen via WebGL or a 2D canvas, we can (and typically do) lose a lot of accuracy.

For instance, if we link the user’s mouse to a camera in a first-person WebGL game and the user is moving around erratically, some of the immersion will be lost as the camera fails to accurately mimic where the mouse is pointed. Or, even more simply, if we want to stamp multiple images onto a 2D canvas wherever the user drags the cursor, chances are we won’t be able to produce a nice smooth curve if the user happens to draw one.

Ultimately, since JS is single-threaded we can’t just have a separate thread running with the sole purpose of collecting mouse coordinates and let the application process the input as fast as it can (maybe a web worker would help here?). Similarly, we can’t very easily prioritize collecting mouse events over the processing that needs to happen, because we can quickly start starving the processing side of things.

Is there some sort of approach that I’m overlooking here? If all an app does is record mouse coordinates, you typically get a very accurate record of where the mouse has been. The problem arises when we have to do some significant, but not unreasonable, processing based on that input in real-time.

  • 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-25T22:17:09+00:00Added an answer on May 25, 2026 at 10:17 pm

    Depending on what you’re doing, you may be able to interleave your processing with event handling by working a little at a time in a timeout handler. This gives the event handlers a chance to fire in between.

    var workInterval = 0; // or try other small values
    function doABitOfWork() {
        // ... Do stuff, but don't take too long ...
        if (!finished) {
            setTimeout(doABitOfWork, workInterval);
        }
    }
    setTimeout(doABitOfWork, workInterval);
    

    I’ve used this trick successfully to make the page responsive while constructing a heavy HTML table.

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

Sidebar

Related Questions

Hi I have this in my application : The question is, should I put
I'm sorry that I put this question because I think that is simple but
I don't know exactly how to put this question. I want to create a
I asked this question in another post - How do I put a <div>
this Question moved to how to prevent an Gated Check-In to put the Keyword
I have a short question. I want do put this \tssr>&\8=f23' into a String
Maybe a very simple question. How can I put in this code <Query> <Where>
My question like this: I have a JTable, I put a JProgressBar in one
I think this is a fairly common question: how to put my business logic
This is my 3rd SO question. Please help again... I want to put up

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.