Official Raspberry Pi keyboard and mouse
What the official keyboard and mouse offer, how to use the keyboard's built-in USB hub, how to connect them to each Raspberry Pi (including the Zero), and how to change the keyboard layout.
What you get
The official keyboard and mouse are wired USB devices designed to match the Raspberry Pi cases. Both come in two colour schemes: raspberry red and white, or black and grey. They work with every Raspberry Pi computer, and with most other computers too, as they're ordinary USB devices.
The keyboard is a compact layout without a separate number pad, with 79 keys (78 on the US version). It's made in these layouts:
| Layout | Language |
|---|---|
| US | English (US) |
| UK | English (UK) |
| DE | German |
| FR | French |
| IT | Italian |
| ES | Spanish |
| PT | Portuguese |
| NO | Norwegian |
| SE | Swedish |
| DK | Danish |
| JP | Japanese |
Australian keyboards follow the US layout, so that's the one most people here want.
The mouse is an optical mouse with three buttons and a scroll wheel. Optical mice need some texture to track, so on a glossy or plain surface such as acrylic or PVC, use a mouse mat.
The lock keys
Three LEDs in the top-right corner of the keyboard show which locks are on:
- Num Lock turns the keys with red numbers printed on them into a number pad.
- Caps Lock types capitals; holding Shift while it's on gives lower case.
- Scroll Lock makes the arrow keys scroll a web page or spreadsheet instead of moving the cursor. There's no separate key for it: hold Fn and press ScrLk.
The built-in USB hub
The back of the keyboard has three full-size USB-A ports (USB 2.0). They're handy for the mouse, a USB stick or a game controller, so you don't have to reach round to the Pi. Plug the mouse in here and its cable runs neatly to either side, for left- or right-handed use.
The hub is powered by the Pi through the keyboard's cable, so anything you plug into it draws from the Pi's USB power. A hungry device such as a portable hard drive is better plugged straight into the Pi.
Because the hub is USB 2.0, a fast USB 3 drive will only run at USB 2 speed through it. Plug fast drives into the Pi's own blue USB 3 ports.
Connecting it
The keyboard has a micro-USB socket on the back and comes with a USB-A to micro-USB cable. The micro-USB end goes into the keyboard; the USB-A end goes into the Pi.
Always power the Pi itself, not the keyboard. The keyboard's socket is for data to and from the Pi. If you plug the power supply into the keyboard and try to run the Pi through it, the keyboard won't work properly.
| Board | Where the keyboard plugs in |
|---|---|
| Raspberry Pi 5, 4, 3 and earlier Model B boards | Any USB-A port. Use a black USB 2.0 port to keep the blue USB 3 ports free on a Pi 4 or 5. |
| Raspberry Pi Model A boards | The single USB-A port. The keyboard's hub then gives you three more. |
| Raspberry Pi Zero, Zero W and Zero 2 W | Needs an adapter (see below). |
| Raspberry Pi 400 and 500 | These already have a keyboard built in. Plug the mouse into one of their USB ports. |
Raspberry Pi Zero
The Zero boards don't have a full-size USB port. They have two micro-USB sockets: one marked PWR IN for power only, and one marked USB for devices. To connect the keyboard you need either:
- a micro-USB OTG adapter (micro-USB plug to USB-A socket), plugged into the socket marked USB; or
- a USB hub with a micro-USB plug, in the same socket.
Then plug the keyboard's cable into the adapter or hub. The keyboard's own hub gives you three more ports for the mouse and a USB stick, so one OTG adapter is usually all a Zero needs. Power still goes into the PWR IN socket.
Changing the keyboard layout
The keyboard tells the Pi which layout it is, so Raspberry Pi OS can normally set itself up correctly. If keys come out wrong (for example @ and " swapped, which means a UK layout is set on a US keyboard), change it by hand.
On the desktop
- Open the Raspberry Pi menu and choose Preferences > Control Centre. (Older releases call this Raspberry Pi Configuration.)
- Go to the Localisation tab and click Set Keyboard.
- Pick the keyboard Model, Layout and Variant. For an Australian or US keyboard, choose English (US).
- Click OK, close the window and reboot.
The same dialog has an Add alternate keyboard option if you switch between two layouts. If you set one up, don't choose Num as the indicator on the official keyboard or a Pi 400, or the Num Lock number keys on the right-hand side will type letters instead of numbers.
From the command line
On Raspberry Pi OS Lite, or over SSH, run:
sudo raspi-config
Then choose Localisation Options > Keyboard and work through the screens: keyboard model, layout, which key acts as AltGr, and a compose key. Use Tab to reach <OK> on each screen, then <Finish>.
The desktop and raspi-config keep separate keyboard settings, so if you use both the desktop and the console, set the layout in each.