Instance Method

performKeyEquivalent(with:)

Handle a key equivalent.

Declaration

func performKeyEquivalent(with event: NSEvent) -> Bool

Parameters

event

An event object that represents the key equivalent pressed.

Discussion

Override to handle key equivalents. If the character code or codes in event match the receiver’s key equivalent, the receiver should respond to the event and return true. The default implementation does nothing and returns false.

See Also

Responding to Key Events

func keyDown(with: NSEvent)

Informs the receiver that the user has pressed a key.

func keyUp(with: NSEvent)

Informs the receiver that the user has released a key.

func interpretKeyEvents([NSEvent])

Handles a series of key events.

func flushBufferedKeyEvents()

Clears any unprocessed key events when overridden by subclasses.