[Vm-dev] Primtive 91/primCursorLocPut:

tim Rowledge tim at rowledge.org
Mon Dec 23 19:02:48 UTC 2019


I have to admit that I'm horrified that we still have the long-deadEventSensor>primSupportCurosorLocPut: method in the system - and not even deprecated! Clearly we need to remove the stupid prim call and I suppose we should be kind and merely deprecate some senders. Mind you that includes several moderately important methods in MVC-land (Controller>>#centerCursorInView, which is used by ControlManager>>#scheduled:from: and FillInTheBlank>>#show:, for example). Sigh.
Well spotted!



> On 2019-12-22, at 10:34 PM, Tom Beckmann <tomjonabc at gmail.com> wrote:
> 
> Usecases: for example in Photoshop you often have number inputs on the far right side of your monitor. These support clicking and dragging for changing the value. However, the cursor will almost immediately hit the right edge of the screen. To prevent this, the cursor position will keep being reset to the center of the slider element while the user is dragging.
> Further, games often use mouse input as a relative number, rather than absolute, by forcing the cursor to the center of screen after each frame and only taking the movement between each frame. This is most commonly seen in games with first person perspective.

Surely the logic here is to keep the value of the last read (hardware) cursor position and then subtract it from the position next time around? And, of course, save that new position for the next cycle etc. You can set the HandMorph to use a suitable Form during the time you are doing this; probably something non-visible? Take a look at senders of  HandMorph>>#showTemporaryCursor: for some ideas.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Fractured Idiom:- ICH LIEBE RICH - I'm really crazy about having dough




More information about the Vm-dev mailing list