Answer the question
In order to leave comments, you need to log in
How to "lock" the mouse cursor in the browser window?
Actually the question is how to "lock" the mouse cursor in the browser window? The goals are exceptionally good: a toy-“walker” from the first person, I would like to control it like in Quake - look around with the mouse.
This cannot be done using the browser. Adobe Flash also, in my opinion, does not know how. Thus, there is only one (terrible) way - to make a Java applet.
Habrasobshchestvo, what did I miss? I will accept the most insane options as a gift.
Try to build a plug-in like Quake Live?
Answer the question
In order to leave comments, you need to log in
Sorry, but you have a "brain thin client". You are trying to push powerful functionality into the browser.
Without a powerful plug-in for the browser, it is unlikely that at least something sensible will work out. And then it makes no sense to file under the browser.
Without a powerful crutch is unlikely to come out. How many games have already seen, and not bad ones, and controlling the mouse that flies out of the game window in the browser killed a lot of buzz. In addition, it will be necessary to provide for a simple procedure for exiting "to the outside world."
In all shooting games, this is implemented through an interval function that calculates the difference between the cursor position and the center, passes the data to the game engine, and forces the mouse to the center of the screen. This happens so often that the jumps are imperceptible.
But what if you try using CSS to specify the standard cursor for the block in the form:
div {cursor: url(blabla.cur)}
And make .cur an empty transparent file?
Alternatively, switch the browser to full screen mode - then the cursor will simply have nowhere to run away.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question