EditorGUIUtility.AddCursorRect() not Updating Reliably

I’m using EditorGUIUtility.AddCursorRect to modify the cursor over an element in a custom Editor Window. I want to switch the mouse cursor between two options depending on the state of whether or not the ALT button is held down. I am doing this by testing against Event.current.alt. I am trying to enable modal mouse selection with cursor hints (think: how the mouse cursor changes in image editing applications with modifier keys held while moused over selections).

The problem is that the update is not immediate. It sometimes takes several seconds and moving the mouse around [slowly seems to work best] for the update to register.

I feel like the speed shouldn’t be a problem given how changing the mode with keys in the main Unity Scene changes the cursor between the hand pointer (q) and normal mouse pointer (w). Do that at any frequency and it immediately responds.

Why does it take so long for the Mouse Cursor to change? What am I doing wrong?

I’m on Unity Pro 4.5.5f1.

If I call Repaint() in Update the changes are detected perfectly, it turns out. The problem is that I do not want to constantly Repaint.

I’m not seeing any events occur when the ALT key is pressed or released in Unity. Is this normal? How do you detect when one of those buttons is pressed?

Unity does not send “KeyDown/KeyUp” events for Meta keys, it seems. At least not through the standard OnGUI interface. It wasn’t being called when I pressed any of the standard meta keys (Shift, Control, Win/Command, Alt/Option).

I was able to work around this by using C# Reflection in my Update() code to grab Event class’ internal “current” object. I then queried that to see if the Alt key status had changed and call “Repaint()” if it has.

I now have a responsive UI. I would really love to handle this without Reflection (dangerous), though. If anyone has any ideas on how to get this information I’m all ears!