From the lab

Keyboard pedal for more efficient coding

For programmers with overstrained fingers, a foot pedal can be a good relief for certain types of commands. But the best products are expensive, so we decided to build our own.

Tech used

  • Raspberry Pi Pico
  • CircuitPython
  • USB Overdrive
  • Karabiner-Elements

Background

During Prototyp Week, our developers Christina and Adam formed a creative duo. They wanted to explore if it was possible to create their own foot pedal connected to the keyboard to ease some of their coding. There are several similar products on the market, but a model like Savant Elite2 can cost around 3,000 SEK. Building their own version seemed like a reasonable task. Plus, there was the opportunity to design it according to their own wishes.

The Process & Challenges

The team began looking at two different types of microcontrollers – Arduino Micro and Raspberry Pi Pico. They chose the Raspberry model because it was more readily available.

By connecting mono jack connectors to the microcontroller's GPIO, they could easily read the values in CircuitPython. Then, they started the work of linking the pedal presses to unique commands on the keyboard.

Halfway through the project, there was a desire to add a sleek case to the unit. This demanded some extra work, as they had to attach the mono jack connectors to the case and devise a way to connect the Pico to the computer. This was achieved with a bit of craftsmanship, a diamond file, and super glue to attach a USB-C to Micro-USB dongle to the case.

A challenge was to enable the use of modifier keys like Shift and Ctrl, as they only work within the same keyboard. To solve this problem, software such as Karabiner-Elements and USB Overdrive was used.

Result / Key takeaways

Key mapping is a jungle in itself, with different approaches for different operating systems. It turned out to be harder than they thought.

The main lesson from the project was that it is entirely possible to further develop the product by swapping out pedals to experiment with the tactile feeling, different sizes, or faster clicks.

Future Actions

A low-hanging fruit is to switch to wireless Bluetooth connection in the future, for example with the help of MicroPythonBLEHID.

Using the pedals for other mouse buttons than the three most common ones proved to be a challenge. Next time, the team wants to try editing the source code to experiment with this as well.