SetCursor outside of the Get commands

Is there a way to change the default cursor other than from the GetPoint command?

On Windows, trying to change it in a MouseCallback works for a split second, but moving the mouse brings back the default arrow:

        protected override void OnMouseEnter(MouseCallbackEventArgs e)
        {
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Cross;
        }

I’ve found a workaround where I hide the default cursor and draw my own in OnMouseMove, but this means the whole viewport needs to be redrawn each time the mouse is moved. Are there more efficient ways of doing this, maybe?

        protected override void OnMouseEnter(MouseCallbackEventArgs e)
        {
            System.Windows.Forms.Cursor.Hide();
        }
        protected override void OnMouseLeave(MouseCallbackEventArgs e)
        {
            System.Windows.Forms.Cursor.Show();
        }

Hi @mrhe,

I don’t believe this is possible. Why do you want to do this?

– Dale

Hi @dale,

I’m developing a custom sculpting plugin and find the default arrow a bit too obtrusive. Here, you can see the workaround I came up with, using a custom conduit updated on OnMouseMove. Ideally I’d like to have the option to just change the default cursor outside of the Get() command, though.

1 Like

This functionality already exists in Rhino. Check out the _DragMode. Its settings are persistent even after the command:

@dale, would that be something you could expose to developers in RC?