Detecting option key press only

I know I can detect the option key being depressed in an event such as mouse move, mouse drag, etc, but my goal is for the window to detect it in the first place.

I want a user to be able to press the option key and an icon changes to a different icon. It does change, but only when an event is firing like mouse move or mouse drag. Apparently I can detect the letter “a” or other letting being used in a window, but not option.

Any ideas?

Add this subclassed Timer to your window then implement the events.

Thanks

How do I use it though? Does it not go on the window that I am using? Does it not have a mode or period?

Add it to your window, set it’s period to something quite small say 100ms mode multiple. You’ll see it exposes Keyup & down events. In the keydown event change the cursor using self.cursor = system.cursors… which ever you want. In the keyup event change the cursor back to standardpointer.

[quote=17515:@Required Required]I know I can detect the option key being depressed in an event such as mouse move, mouse drag, etc, but my goal is for the window to detect it in the first place.

I want a user to be able to press the option key and an icon changes to a different icon. It does change, but only when an event is firing like mouse move or mouse drag. Apparently I can detect the letter “a” or other letting being used in a window, but not option.

Any ideas?[/quote]
Have you looked at the Keyboard.Async methods ?
You can call those at any time