Returns a new
NSEvent object describing a key event.
- macOS 10.0+
One of the following event-type constants:
NSFlags. If anything else is specified, an
The cursor location in the base coordinate system of the window specified by
An integer bit field containing any of the modifier key masks described in Getting Unicode Values, combined using the C bitwise OR operator.
The time the event occurred in seconds since system startup.
An integer that identifies the window device associated with the event, which is associated with the
NSWindowthat will receive the event.
The display graphics context of the event.
A string of characters associated with the key event. Though most key events contain only one character, it is possible for a single keypress to generate a series of characters.
The string of characters generated by the key event as if no modifier key had been pressed (except for Shift). This argument is useful for getting the “basic” key value in a hardware-independent manner.
YESif the key event is a repeat caused by the user holding the key down,
NOif the key event is new.
A number that identifies the keyboard key associated with the key event. Its value is hardware-independent.
NSEvent instance or
nil if the instance could not be created.