Here is a quick article to help you if you’re having issues with a keyboard attached to a Mac. This might sound silly, but it does happen!

Firstly- Try to save your open documents- use the mouse if needed. Next, Are you sure the keyboard is the problem?
Try this key combination-
Command-Shift-Escape

That should bring up the ‘Force Quit’ dialog box. If that comes up, then your keyboard isn’t the issue, maybe your app has crashed. You can get out of the dialog by hitting the Escape key, or clicking the red dot in the dialog frame.

Another key combination to try is-
Shift-Tab
Hitting shift-tab will cycle through your open applications… see if you can type into a different application.

If none of the key combinations work, try these steps

Wired Keyboards
1. Unplug it, wait a couple of seconds, then replug
2. Try a different USB port
3. Try a different keyboard (most people have a spare somewhere!)

Wireless Keyboards
1 . Plug in the USB cable, wait a couple of seconds, then unplug it. for Apple wireless keyboards, this refreshes the link between keyboard and computer
2. Make sure the keyboard isn’t out of battery power
3. Try a different keyboard (you should always keep a cabled keyboard around, should cost you <$20)
4. Reset the keyboard to factory defaults and try to re-pair it with your computer
5. Try your keyboard on another computer

If none of these steps work and the key combinations don’t work, maybe your computer has frozen. Restart it by holding down the power button for 8 seconds, and hope that you saved recently…

Here’s a handy reference for other keyboard tricks-
Mac Startup key Combinations
My Mac doesn’t turn on
Mac Keyboard Shortcuts