s12wu / laptop-keyboard-reader

Raspberry Pi Pico Circuitpython code to read a laptop keyboard and present it as USB HID to a Computer
GNU General Public License v3.0
6 stars 0 forks source link

Are all the keys working right? #1

Open martinlombana opened 10 months ago

martinlombana commented 10 months ago

Hi there, and thanks for sharing this. I am interested, myself, in using this as a controller for a Y480 lenovo keyboard. But I am wondering if you could share you experience with it after all this time: 1) Are all keys functional? (Including FN?) 2) Can you create your own mappings for the FN key or modifications? 3) Is there any input lag, or problems so far?

Using a pico is much cheaper than a teensy, hence my interest. Specially if I can use python.

Thanks so much.

s12wu commented 10 months ago

Hi martinlombana, I'm glad you like it! I still use it every day as part of a "renewed" netbook - which is slow (the computer, not the keyboard), but I love it

  1. Yes, every key is functional and except for the FN key, they are passed through USB HID. Keyboard shortcuts work as expected - there's a list of the current state of all the keys, and if any of them change (press or release), the change is reported to the adafruit_hid library.
  2. The FN key can be used to perform any custom function - https://github.com/s12wu/laptop-keyboard-reader/blob/master/code.py#L165 . For example, I use it to control the volume and display backlight. My own keyboard had a pin ripped off the ribbon cable after half a year, so I created shortcuts using the FN key to replace the lost keys.
  3. No. The system it's connected to isn't that fast (Radxa Zero 1.4 with 1GB ram, Manjaro XFCE), but the response time feels great.
martinlombana commented 10 months ago

Nice to hear! The keyboard that I will use is this one: image

It has a 24 pin connector. Any tips for the wiring, in this case? Would I really need a port expander, or I should be fine?

Thanks!!

s12wu commented 10 months ago

As long as each pin of the connector goes to a separate GPIO, you don't need a port expander. I just needed it because I have some more peripherals connected to the Pico. You could use GP0 to GP22 and GP26 to connect your keyboard, remember to use external pull-up resistors