Simple Pico Custom Keyboard

by 陳亮 in Circuits > Arduino

1035 Views, 11 Favorites, 0 Comments

Simple Pico Custom Keyboard

IMG_0532.jpeg
IMG_0539.jpeg
Simple Pico Custom Keyboard

This instructables show how to build a super simple custom keyboard.

This project only requires 2 components and even not require soldering.

Supplies

IMG_0520.jpeg

Raspberry Pi Pico RP2040 dev board

ST034 button module or any button module you have in hand

Why Custom Keyboard?

IMG_0322.jpeg

Tradition full size keyboard have 104/105 keys. However smaller size keyboard may miss some keys. For example, my currently using keyboard did not have a print screen key. It is a little bit clumsy when I need some screen capture for documentation. Same situation for missing HOME, END, PAGE UP and PAGE DOWN keys. So I would like to add some keys back.

Software Preparation

Please follow the installation instruction to install Arduino-pico support if not yet:

https://github.com/earlephilhower/arduino-pico

Assembly

IMG_0525.jpeg
IMG_0528.JPG
Simple Pico Custom Keyboard Assembly

Please follow the video for assembly. Something highlight, the Pi Pico pins have a GND pin in the middle between GPIO 2-9. So it needs to bend the pin headers a little bit to skip this pin.

Sample Program

I prepared a simple sample program based on Pico keyboard.ino example:

https://github.com/moononournation/PicoKeyboard.git

This sample program use an interrupt function stored the GPIO status while key pressed down (falling signal), then check the stored status in loop() function then trigger a key press to emulated USB keyboard.

For example, check K1 pressed:

if ((pin_status & (1ul << BTN_K1_PIN)) == 0) {

If K1 pressed, emulate a print screen key press:

    Keyboard.press(KEY_PRINT_SCREEN);
    delay(100);
    Keyboard.releaseAll();


More key defination can be found at HID_Keyboard.h:

https://github.com/earlephilhower/Keyboard/blob/c0f474695f83d63209fe4ad73ec5d90f27cd9e64/src/HID_Keyboard.h

Advanced Use

You may already found fit can emulate more complicate key combination. E.g. Ctrl-K then Ctrl-D for the format shortcut in VSCode. In the Pico original keyboard.ino example, it even can emulate typing the password (But it is not a good idea through...).

Some new Windows notebook have a new special key dedicate for calling copilot.

Pushing a computer's integrated Copilot button is like pressing left-Shift + Windows key + F23 simultaneously.

The keys are hard to found from any keyboard in the market, but you still can emulate the new key by this custom keyboard.

Ref.:

https://blogs.windows.com/windowsexperience/2024/01/04/introducing-a-new-copilot-key-to-kick-off-the-year-of-ai-powered-windows-pcs/

https://arstechnica.com/gadgets/2024/04/shoehorned-windows-copilot-key-is-just-a-reprogrammable-macro-journalist-shows/

Enjoy!

IMG_0535.jpeg
IMG_0537.jpeg