---
title: "Mouse, Keyboard, and Trackpad"
framework: appkit
role: collectionGroup
role_heading: API Collection
path: appkit/mouse-keyboard-and-trackpad
---

# Mouse, Keyboard, and Trackpad

Handle events related to mouse, keyboard, and trackpad input.

## Overview

Overview The NSResponder class defines the responder chain, an ordered list of objects that respond to user events. When the user clicks the mouse button, taps on the trackpad, or presses a key, an event is generated and passed up the responder chain in search of an object that can respond to it. Any object that handles events must inherit from the NSResponder class. The core AppKit classes, NSApplication, NSWindow, and NSView, inherit from NSResponder. An NSApplication object maintains a list of NSWindow objects—one for each window belonging to the app—and each NSWindow object maintains a hierarchy of NSView objects. This view hierarchy is used for both drawing the user interface and for handling events. An NSWindow object handles window-level events and distributes other events to its views. An NSWindow object also has a delegate allowing you to customize its behavior.

## Topics

### Responder Objects

- [NSResponder](appkit/nsresponder.md)

### Mouse, Keyboard, and Touch Events

- [NSEvent](appkit/nsevent.md)
- [NSTouch](appkit/nstouch.md)

### Trackpad

- [NSPressureConfiguration](appkit/nspressureconfiguration.md)
- [NSHapticFeedbackManager](appkit/nshapticfeedbackmanager.md)

### Constants

- [NSEvent.EventTypeMask](appkit/nsevent/eventtypemask.md)
- [NSEvent.ButtonMask](appkit/nsevent/buttonmask-swift.struct.md)
- [NSEvent.ModifierFlags](appkit/nsevent/modifierflags-swift.struct.md)
- [NSEvent.Phase](appkit/nsevent/phase-swift.struct.md)
- [NSEvent.SwipeTrackingOptions](appkit/nsevent/swipetrackingoptions.md)
- [init(type:)](appkit/nsevent/eventtypemask/init(type:).md)

## See Also

### User Interactions

- [Menus, Cursors, and the Dock](appkit/menus-cursors-and-the-dock.md)
- [Gestures](appkit/gestures.md)
- [Touch Bar](appkit/touch-bar.md)
- [Drag and Drop](appkit/drag-and-drop.md)
- [Accessibility for AppKit](appkit/accessibility-for-appkit.md)
