Returns a new Quartz keyboard event.
- macOS 10.4+
- Mac Catalyst 13.0+
- Core Graphics
An event source taken from another event, or
The virtual key code for the event.
trueto specify that the key position is down. To specify that the key position is up, pass
false. This value is used to determine the type of the keyboard event—see
A new keyboard event, or
NULL if the event could not be created. When you no longer need the event, you should release it using the function
All keystrokes needed to generate a character must be entered, including modifier keys. For example, to produce a 'Z', the SHIFT key must be down, the 'z' key must go down, and then the SHIFT and 'z' key must be released: