Steps for a wireless keyboard

Make sure that your keyboard is turned on. If you have a Magic Keyboard or Magic Keyboard with Numeric Keypad, slide the power switch on the back of the keyboard to turn it on (green is visible when the keyboard is on). If you have an Apple Wireless Keyboard (late 2015 or earlier), press the power button on the right side of the keyboard. The green LED on the upper right side of the keyboard briefly lights up.

Verify that the keyboard is connected by pressing the Caps Lock key. If the keyboard is connected to your system, the Caps Lock light turns on when you press it.

Plug your keyboard and mouse back into your computer firmly and securely. Make sure that the connector is completely in the port. (USB plugs fit into ports one way only, and won't plug in if you try to insert them upside-down.)If you have a Magic Keyboard or Magic Keyboard with Numeric Keypad, also make sure that your Lightning to USB cable is securely connected to the Lightning port on the back edge of the keyboard.

If your keys still don't work, try plugging your keyboard in to the other USB ports. Be sure to try them all. Check to see if the keyboard's Caps Lock light turns on when you press it, and try typing in an app like Notes or TextEdit.Magic Keyboard and Magic Keyboard with Numeric Keypad use a Lightning to USB cable. Make sure that the cable you're using is the one that came with the keyboard, or is a Lightning to USB cable that you know is in working order. You can try a different Lightning to USB cable to test whether the cable is causing the issue.

Other tips for fixing issues with your USB keyboard:

If your keyboard works in one of your USB ports but not all, your computer might need service.

If only some keys on your wireless, USB, or built-in keyboard work

If some keys on your keyboard work and others don't, try these steps.

Caps Lock key

The Caps Lock key is designed to avoid accidental activation. If the Caps Lock key doesn't turn on with a quick tap, hold the key down for about one second, or until the key's green indicator lights up. Do the same to turn off Caps Lock.

Media Eject key

The media eject key has a slight delay to keep it from being used accidentally. Hold down the key until the Media Eject icon appears on your screen.

Other keys

You might have set an option that changes how your keyboard operates. Choose Apple () menu > System Preferences, and then try these tips:

In the Accessibility pane, click Speech in the left side. If "Speak selected text when the key is pressed" is selected, deselect it or click Change Key to select another key.

In the Accessibility pane, click Keyboard. Make sure Enable Slow Keys is turned off. If it's on, you have to hold down a key longer than usual before it's recognized.