Is there a way to make a "ghost cursor" in any language?
The term "ghost cursor" is a bit confusing; what I mean is a mouse cursor that isn't controlled by the user, but is created and completely under the control of a program. That means that there are now 2 cursors on the screen, instead of just one.
Is the concept of having more than 1 cursor on the screen possible? If it is, what are th开发者_JAVA技巧e ways/what is the way to make it happen? The programming language doesn't really matter to me, as what can be done in one language can most likely be reproduced in another.
In case you were wondering what this is for, it's actually just for general knowledge and of course the awesome idea of having more than one cursor.
Thanks very much in advance.
Edit: To all the answerers as of yet - You all gave nice examples, but they don't quite hit the spot. The new cursor is to be a new cursor on the screen of the client, and that cursor behaves like a regular cursor; except that it's controlled by the program. It's not a replacement for the existing cursor or an image. It's a component that can left click and right click, move about the screen, drag and drop and everything else.
Yes. On a Silverlight project about a year ago, I wanted to replace the standard pointer cursor with one of my own. In order to do this I turned off the default cursor and rendered my own cursor in response to mouse events. It would be simple enough to create a clone of the custom cursor and write code to drive it around the screen so that you have two cursors simultaneously.
The same thing should be able to be done on other platforms. It would also be easy to do the same thing in a DOS app or DirectX app where you are able to take full control of the screen.
Well for example you could in:
FLASH - Make an actionscript that follow the user cursor and after sometime later it begins to copy the movements and click events.
JavaScript - Same idea as FLASH
QT - Same as the other guys.
Anyway there might be several ways to use this:
To make an artificially intelligent controlled cursor which knows what to do in a specific time or after a specific event.
To show a user what to do as a help desk cursor (Something like lmgtfu "Let Me Google That For You")
To play PONG with another cursor that learns
You need a web socket server that can update the client browser in real time. Check out this example of multiple 'ghost' mouse cursors using node.js. It's pretty neat--every visitor sees the mouse cursors of all the other visitors on the page in real time.
精彩评论