I have a NSView
subclass and I would like it to react when the user presses the ⇧ Shift key. However, -[NSView keyDown:]
(which I curren
What do you do if the key press does not come as an event? For example, you want to test the state of the Shift key when the program starts up? The Shift key was pressed before the program started, and will not be released until after you test its state.
In Windows, you can easily get this with a call to GetKeyState(VK_SHIFT)
. What is the macOS equivalent?