Duplicate Pocket Reform Keystrokes Over USB?

I hope to use my on-order Pocket Reform to shrink the weight of my traveling office. In particular, could it replace my portable mechanical keyboard?

Ideally, I would connect the Pocket Reform to another computer via USB-C and run a program that simulates a USB keyboard Device on the Reform, duplicating all keystrokes to the computer acting as USB Host. Usually, this is impossible without additional hardware: USB controllers on most laptops can only act as Host, not Device (I think).

But! According to the fact sheet for iMX8M+, the USB controller is “dual-role” which seems like it does exactly what I want: allow Pocket Reform to put a USB port into Device mode and simulate a keyboard attached to another computer in Host mode.

Some questions:

  1. Is this possible (in principle) with no additional hardware beyond an appropriate USB-C cable? This question is about the Pocket Reform SoM, which I have a very limited understanding of.
  2. What should I start reading to implement this, if it is possible? I have no experience whatsoever with linux kernel development, but preliminary searches suggest I should configure this HID gadget driver somehow. I can write simple C and Rust programs.
  3. Am I overlooking a better, no-internet and no-additional-hardware way to move text from my Pocket Reform to a broad range of devices? Maybe bluetooth would serve just as well? This idea for Pocket Reform is inspired by the AlphaSmart, which could “squirt” text to nearly anything by simulating a hardware keyboard.

Some general comments & context:

In the long run I hope my Pocket Reform will grow into a rock-solid portable “typewriter” — a durable and repairable device heavily optimized for text editing. I am willing to put in substantial effort to make this happen, because there are at least 25 more years of professional LaTeX writing and frequent travel left in my career (if I remain lucky).

1 Like

It is probably possible to turn the Pocket into a USB gadget via its USB-C connection but I would not know how to do that and am not aware of existing solutions that you could use to get what you want over USB. But reading what you wrote made me think of the usbip project: https://usbip.sourceforge.net/
Maybe this can be used to use the USB keyboard of the Pocket Reform on another computer over an existing IP connection so if both are in the same wifi network, then the setup would even be wireless.

Another thougt: at some point (I fail to find the quote right now) @minute mused on IRC about a possible wireless bluetooth keyboard/trackball combo using the existing parts. If MNT made a wireless keyboard I’d imediately buy it. I’ve gone through several wireless keyboards to control my (soon to be MNT powered) mediacenter PC and they all suck in one way or the other. :frowning:


Typically transferring long texts through input emulation is problematic. At some point you are going to lose characters because of buffering limits on the remote side.

Back in the day when I had a similar use case, I’ve ran Barrier (GitHub - debauchee/barrier: Open-source KVM software), a fork of Synergy (which was too heavy to work on the computer I was using as my input device). While it requires a network, and has some minor quirks, it’s a really nice experience when set up. It also makes it easy to seamlessly switch between devices, so you could use your pocket seamlessly and just switch to your other computer(s) like they’re monitors on your pocket.
Just keep in mind that in that case, the Pocket would be a server, and everything connecting to it would be running a client.

Seems that has moved GitHub - input-leap/input-leap: Open-source KVM software