Live data from Hacker News

Raw Gadget is a kernel module that allows to emulate USB devices from userspace

github.com

21–26 of 26 posts

Re: Raw Gadget is a kernel module that allows to emulate USB devices from userspace

#21
post #17

Earlier quoted context omitted.

If you're not designing your own microcontroller, you might want to check out the Proton-C. It has 248kB of usable flash memory, which could be enough to store a stenography-optimized word list in addition to the firmware. It was made to be flashed with the qmk keyboard firmware, but I don't think there's any requirement that you have to use qmk. https://qmk.fm/proton-c/

I used an STM32F103 for my last keyboard, and you can buy four for the price of a Proton C. I am still not sure why they chose the F3 series for the Proton C, as it doesn't seem to be a chip that's commonly used in the maker community. I am somewhat surprised they didn't bite the bullet and just port QMK to the nRF52 (since everyone wants bluetooth out of the box), actually. The F103 is also interesting in that it is…

I was actually planning to run it on F103 as I already have couple of them laying around. And I also wanted to try it in Rust mostly to get some experience with it.

I was initially thinking about something that is already bluetooth enabled like ESP32 or CC2640R2 (I have development boards for both of these) but the design suddenly gets exponentially more complex if you want to get it right. Also, neither has a package that I can easily solder. I know it is just aesthetics, but I really like a clean board.

Re: Raw Gadget is a kernel module that allows to emulate USB devices from userspace

#22
post #18
post #10

This is really fantastic. I am currently building my own keyboard with my own controller and it will be much easier for me to first implement mock controller in userspace before I try to get it right on external device. Especially because I will want to put some complicated functionality in it like steno.

I am very interested in USB / stenography / chorded typing http://tbf-rnd.life/

So the idea is to have a kind of blank slate, 40 to 60% ortholinear keyboard, that I will be able to experiment with.

The base layout will be a small grid that will fit traditional (ie. dvorak;) layout but that I will also be able to change to my liking. I plan to be able to experiment with 3d printed keys to support traditional steno or maybe some other chorded method. I don't have much experience with steno so I want to keep my options open.

Configuration and dictionaries will be provided on an SD card.

The keyboard will be reversible (ie. the enclosure such that it will be possible to rotate entire mounting plate with the switches and PCB) to provide negative slope.

And yes, it will be RGB because even if the keys are not marked it is still nice to be able to see individual keys in the dark for more complicated Emacs bindings...

Re: Raw Gadget is a kernel module that allows to emulate USB devices from userspace

#23
post #22
post #18

Earlier quoted context omitted.

I am very interested in USB / stenography / chorded typing http://tbf-rnd.life/

So the idea is to have a kind of blank slate, 40 to 60% ortholinear keyboard, that I will be able to experiment with. The base layout will be a small grid that will fit traditional (ie. dvorak;) layout but that I will also be able to change to my liking. I plan to be able to experiment with 3d printed keys to support traditional steno or maybe some other chorded method. I don't have much experience with steno so I wa…

I currently use an ergodox running TMK with support for Plover. The layout is shown at https://gist.github.com/nelstrom/11232558

If I were trying to do the project you are talking about, I would experiment with coming up with a way for a Raspberry Pi running Plover to act as a usb gadget to connect to your work PC. I'd think it'd also be quite simple to get Plover to output words over serial to an atmega32u4 that can act as a HID keyboard.

So you have keyboard -> RPi with Plover -> Atmega32u4 -> Work PC.

Then you don't have to come up with the chording/dictionary support yourself.

In fact I've had a very similar project on the backburner myself. I'm planning to eventually end up with an nrf52840 combined with a RPi Zero W, so the entire device can act as a bluetooth keyboard with chording support for any PC or phone that can use a bluetooth keyboard.

I haven't made a lot of progress so far however.

Re: Raw Gadget is a kernel module that allows to emulate USB devices from userspace

#24

Earlier quoted context omitted.

No, this allows userspace to act as a USB gadget connected to the Linux kernel it's running on.

It sure doesn't seem to. That's why they have a separate subproject for it- https://github.com/xairy/raw-gadget/blob/master/dummy_hcd/RE... But you certainly could know more than me about it! Why do you think it's exclusively for acting as a USB gadget connected to the Linux kernel it's running on?

It looks like I'm only partially right: dummy_hcd is just for the local kernel, but raw gadget is just yet another interface to the UDC, so like usb functionfs just without sanity checks.

I found documentation about this in the submission to mainline: https://lwn.net/ml/linux-usb/461a787e63a9a01d83edc563575b858...

Re: Raw Gadget is a kernel module that allows to emulate USB devices from userspace

#25
post #22

Earlier quoted context omitted.

So the idea is to have a kind of blank slate, 40 to 60% ortholinear keyboard, that I will be able to experiment with. The base layout will be a small grid that will fit traditional (ie. dvorak;) layout but that I will also be able to change to my liking. I plan to be able to experiment with 3d printed keys to support traditional steno or maybe some other chorded method. I don't have much experience with steno so I wa…

I currently use an ergodox running TMK with support for Plover. The layout is shown at https://gist.github.com/nelstrom/11232558 If I were trying to do the project you are talking about, I would experiment with coming up with a way for a Raspberry Pi running Plover to act as a usb gadget to connect to your work PC. I'd think it'd also be quite simple to get Plover to output words over serial to an atmega32u4 that can…

RPi Zero would be possible to put inside the keyboard (aside from its physical footprint) although it will limit where I can connect the keyboard (due to power drain). But then I will also have to forget about bluetooth and making it battery powered later because 200mA is I think the lowest I could get with this design with bluetooth enabled.

Re: Raw Gadget is a kernel module that allows to emulate USB devices from userspace

#26
post #25

Earlier quoted context omitted.

I currently use an ergodox running TMK with support for Plover. The layout is shown at https://gist.github.com/nelstrom/11232558 If I were trying to do the project you are talking about, I would experiment with coming up with a way for a Raspberry Pi running Plover to act as a usb gadget to connect to your work PC. I'd think it'd also be quite simple to get Plover to output words over serial to an atmega32u4 that can…

RPi Zero would be possible to put inside the keyboard (aside from its physical footprint) although it will limit where I can connect the keyboard (due to power drain). But then I will also have to forget about bluetooth and making it battery powered later because 200mA is I think the lowest I could get with this design with bluetooth enabled.

You are right about battery issues with RPi.

I was planning to have a way to disable the RPi and have it just act as a basic bluetooth keyboard so I can save battery when I'm not using Plover.

Post reply on HN