Code Monkey home page Code Monkey logo

prk_firmware's Introduction

Ruby CI

PRK Firmware

PRK Firmware is an award-winning DIY-keyboard firmware framework written and configured in PicoRuby which is an alternative mruby implementation targeting one-chip microcontrollers.

Features

  • A "keymap" can be configured in Ruby which is a concise, readable and happy language
  • RP2040 is the target platform microcontroller
  • You can extend your keyboard with the power of Ruby (watch the presentation videos below)

Getting started

See wiki/Tutorial

Presentations

The author gave a talk about PRK Firmware in RubyConf 2021.

See the video on YouTube.

Japanese talk is available at RubyKaigi Takeout 2021.

Contributing

Fork, patch and send a pull request.

Unlike QMK Firmware, prk_firmware repository doesn't include individual keymaps.

See also wiki/README if you are willing to help us with documentation.

License

Copyright Β© 2021-2022 HASUMI Hitoshi (@hasumikin). See MIT-LICENSE for further details.

PicoRuby

prk_firmware's People

Contributors

arai-ta avatar buty4649 avatar geeknees avatar harukasan avatar hasumikin avatar hiy avatar kazhida avatar lvela avatar seisuke avatar shugo avatar takkanm avatar taro-hayashi avatar yoichiro avatar yswallow avatar yujiyokoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prk_firmware's Issues

CAPSLOCK LED / RGB_TOG AND COMPOSITE KEYS

Hi,
I've been browsing a lot - I'm not an advanced coder, but can understand enough to get me into trouble!

I would like to toggle a single colour LED with the CAPSLOCK key
i.e. when the matrix scans KC_CAPS and sends HID code #0x39
it also makes GPIO 27 High
when it sends again, it makes GPIO Low

RGB_TOG works to turn an LED off / on (very dim)
but, it doesn't seem possible to create a composite key that does RGB_TOG and KC_CAPS at the same time?
the macro function doesn't seem to accept RGB_TOG either

If this is possible with RGB only, I can change my design to use WS2812

0.9.5 may have a problem

Version 0.9.4 works fine, but 0.9.5 may have a problem. I'm using pipi_gherkin and the keymap is below.

https://github.com/geeknees/keymap/blob/main/prk_pipigherkin/keymap.rb

After upgrading, when I update the keymap, I get a situation where the keys of pause, f13, escape, and 2 are repeated. Here is a capture of the keystrokes for your reference. This is a recording of how the keyboard is connected to the PC and the corresponding key is input without typing.

Nov-13-2021 18-51-45

I am reporting this, although it is not urgent, because the previous version works fine.
If there are any unclear points, please leave a comment so I can investigate.

Also, if there are any steps I need to take to investigate, please let me know. I would like to contribute as much as I can to this project.

🌈Improving RGB feature

Current

Effect modes:

  • :swirl
  • :rainbow_mood

Goal

Effect modes to be added:

  • :breath ... value changes like 0,1,3,4,5,6,7,8,9,8,7,6,5,4,3,2,1,0,1,2,3,4,,,,
  • :nokogiri ... value changes like 0,1,3,4,5,6,7,8,9,0,1,3,4,5,6,7,8,9,0,1,3,4,,,,

Keycodes to be added:

keycode alias functionality swirl rainbow_mood breath nokogiri
RGB_TOG Toggle On or Off
RGB_MODE_FORWARD RGB_MOD Cycle through modes
RGB_MODE_REVERSE RGB_RMOD Reverse direction of _FORWARD
RGB_HUI Increase hue (tone) βœ” βœ”
RGB_HUD Decrease hue βœ” βœ”
RGB_SAI Increase saturation (density) βœ” βœ” βœ” βœ”
RGB_SAD Decrease saturation βœ” βœ” βœ” βœ”
RGB_VAI Increase value (brightness) βœ” βœ” βœ” βœ”
RGB_VAD Decrease value βœ” βœ” βœ” βœ”
RGB_SPI Increase effect speed βœ” βœ” βœ” βœ”
RGB_SPD Decrease effect speed βœ” βœ” βœ” βœ”

Note: On a split-type keyboard, these keycodes only work when they are assigned on a side that is NOT connected to the USB cable.

Pulse Width Modulation Support

Recently, I have designed a new keyboard named "Lunakey Pico" using Raspberry Pi Pico.

yoichiro/prk_lunakey_pico

This keyboard has Underglow LEDs and a piezoelectric speaker. PRK Firmware has already support RGB LEDs. But, currently it does not support the PWM (Pulse width modulation) I/O and a sound feature with it. therefore I can't write a code to sound with the speaker on the keyboard.

If this PRK Firmware supports the PWM I/O API, it would be happy.

Problem when pressing one mode_key while holding down another mode_key

There are key1 and key2.

  • key1 : mode_key for layer switching
  • key2 : mode_key in default layer, normal key after switching layers

The following is an example code.

#                            key1      key2
kbd.add_layer :default, %i(SPC_LAY1, ENT_LCTL)
kbd.add_layer :layer1,  %i(XXXXXXXX, KC_BSPC )
kbd.define_mode_key :ENT_LCTL,[ :KC_ENTER, :KC_LCTL, 200, 200 ]
kbd.define_mode_key :SPC_LAY1,[ :KC_SPACE, :layer1,  200, 200 ]

In this case, I expected BackSpace to be typed by pressing key2 while holding down key1.
In reality, however, Enter is entered immediately after Ctrl+BackSpace is entered.
It seems that both the long-press key of the default layer and the key of layer1 are entered, and the short-press key of the default layer is entered immediately afterwards.

Note that if key2 is not mode_key but a normal key (e.g. KC_LCTL), the behavior is as expected.
This seems to happen only when the key before the layer switch is mode_key.

This occurs in v0.9.13.

composite key on encoder

I wanted to switch windows(tabs) by encoder but this code snippet did't work:

kbd.define_composite_key :NEXTTAB, %i(KC_LCTL KC_TAB)
kbd.define_composite_key :PREVTAB, %i(KC_LCTL KC_LSFT KC_TAB)
kbd.define_composite_key :NEXTWIN, %i(KC_LALT KC_TAB)
kbd.define_composite_key :PREVWIN, %i(KC_LALT KC_LSFT KC_TAB)

encoder_1 = RotaryEncoder.new(28, 27)
encoder_1.clockwise do
  kbd.send_key :NEXTWIN
end
encoder_1.counterclockwise do
  kbd.send_key :PREVWIN
end
kbd.append encoder_1

encoder_2 = RotaryEncoder.new(26, 22)
encoder_2.clockwise do
  kbd.send_key :NEXTTAB
end
encoder_2.counterclockwise do
  kbd.send_key :PREVTAB
end
kbd.append encoder_2

is it not supported, or any mistakes?

thanks

Feature request - GPIO Toggle on/off

#93 Ref this feature - BUT....an 'easy' way...?

a simple toggle of a GPIO when a chosen character code is detected

this could allow an LED (or maybe in future many LED's) to change status on a keypress....

I have this working with a RGB Matrix of 1 in size - the LED turns off and on.
BUT, that key then can not perform any other function (it is Just an LED control Key)
I can see this expanding in future to even have full backlit LED keybaord to react to keypresses with animations
(maybe like water splashing in a pond!)....

A down-side to a simple toggle- this isn't bound to the OS, and could lose sync if used as a Numlock / Capslock / Scroll lock status...
(it's a hack)

Some up-sides,
a keypress could trigger a backlight response on / off. (via a GPIO)

I do believe this is NOT neccessary for PRK firmware (you are right, not many will need / use it)
But, it's a 'fun' thing for the Amiga Mini Keyboard kit that I am making and i'm happy to sponsor the request somehow to put some value to your time

Thankyou team

<<Request>> Macro keys

I would like to have a key where pressing it automatically writes ```, or some other list of characters. Composite keys seem close to what I want, but those press them at the same time instead of one after another. Is this possible?

Different pin-assign between each half of split-type

Actual

  • Different keymap.rb should be put in the other half

Expected for example

kbd.split = true

if kbd.anchor?
  kbd.init_pins(
    [ 4, 5, 6, 7 ],
    [ 29, 28, 27, 26, 22, 20 ]
  )
else
  kbd.init_pins(
    [ 29, 28, 27, 26 ],
    [ 9, 8, 7, 6, 5, 4 ]
  )
end

Mode keys will run a proc placed in "hold" no matter what the hold time is set to

I wanted to make a key that presses backspace if tapped, and keypad enter if held for a while. This is what I ended up writing:

kbd.define_mode_key :ENTER_DEL, [ :KC_BSPACE, Proc.new { kbd.send_key(:KC_KP_ENTER); puts "Enter" }, 10000, nil]

(the long time and the puts is just for testing)
However, if I keep it pressed, "Enter" appears in the console several times.

Now that I think about it, this might be intended behavior. If it is, I would like to request some way of doing what I want here; a key which does one key if tapped, and another if pressed for a while.

init_direct_pins doesn't work in 0.9.11

Hi,

Both options for declaring directly wired pins don't work in 0.9.11. The terminal shows "Undefined local variable..." for both options. In my three photos I show the terminal, the first uses a matrix and the rest use direct pins. The matrix does work.
The same keymap.rb works in 0.9.9 and 0.9.10.

init_pins
set_scan_mode
init_direct_pins

Keymap copied from compressed folder is not recognized

I'm reporting a minor bug I found.

When I copy the keymap.rb file from the compressed(zipped) folder to the PRKFirmware drive in Windows, the keymap is not recognized.
I expect it to be recognized because the same file will be recognized if it is written differently.
After writing in this way, I reset the keyboard and it remains unrecognized. Files look similar when compared using the diff tool. It is recognized when overwritten by a text editor.

Tested with release 0.9.13 on RPi Pico (GRIN Type-R).

I think this is a minor bug and therefore low priority.

Board not detected

My board is detected in BootSel mode. The PRKFirmware drive appears when I install the UF2 file... but once I unplug the board and plug it back in, nothing appears and the keyboard won't work.

I have this issue with KMK as well. It was solved there by defining, then decreasing the startup delay multiplier. I set and adjusted this variable: PICO_XOSC_STARTUP_DELAY_MULTIPLIER. This value is set in a file called: pico-sdk-configboard.h

To do this I had to create my own board within circuitPython and compile my own UF2 file.

I think this all stems from some possible timing mismatches with the crystal on our board.

Is there a way to deal with this in PRK please?

Wrong layer and modifier states

Environment

version: v0.9.12

keymap.rb:

# Initialize a Keyboard
kbd = Keyboard.new

# Initialize GPIO assign
kbd.init_pins(
  [ 27 ], # row0, row1,... respectively
  [ 6,7,8,9 ]  # col0, col1,... respectively
)

kbd.add_layer :default, %i(
  KC_LSFT KC_A KC_B LAYER_C
)
kbd.add_layer :raise, %i(
  ________ KC_1 KC_2 ________
)

kbd.define_mode_key :LAYER_C, [ :KC_C, :raise, 200, nil ]

kbd.start!

hardware:
image

How to reproduce

  1. press & hold KC_LSFT and...
  2. tap KC_A => A πŸ™†β€β™‚οΈ
  3. tap KC_B => B πŸ™†β€β™‚οΈ
  4. tap LAYER_C =>
    • expected: C
    • actual: reported nothing πŸ€”
  5. tap KC_A =>
    • expected: A
    • actual: 1 πŸ€”

Problem with keymap not being recognized properly when connecting to Remap.

I used PRKFirmware 0.9.14 and created the Firmware using the following document.
https://github.com/picoruby/prk_firmware/wiki/VIA-and-Remap

If I fill in the keymap directly in via_map.txt, it works fine.
On the other hand, when I connect to Remap, the keyboard is detected by the information in prk-conf.txt, but
the following anomaly occurs and I cannot change the keymap properly.

  • The keymap displayed in Remap is different from what I set.
  • When I edit the keymap in Remap and flash it, the changes are reflected in only some keys.
  • When I flash a keymap in Remap, the file is corrupted.
  • The key tester in Remap is not working.

#Windows10
#Chrome (103.0.5060.114)
#PRK Firmware (0.9.14)
#keyboard:OLSK60 (Adafruit KB2040)
https://github.com/techmech-keeb/OLSK60/tree/main/PRK_Firmware

Dockerfile fails

Hello

Thanks for sharing your very interesting project!

I m interested in building a binary but, I guess the instructions in the wiki will only work in linux right? for me reading about it for the first time it was not obvious I tried and fail miserable in Macos catalina (suggestion add some pointers for the environment and requisites).

Then I tried and fail building the Dockerfile

last messages:

=> => transferring context: 2B 0.0s
=> [build 2/16] RUN apt-get update && apt-get install --no-install-recommends -y 207.0s
=> [build 3/16] WORKDIR /prk_firmware 0.5s
=> [build 4/16] COPY . . 0.3s
=> [build 5/16] WORKDIR /prk_firmware/src/ruby 0.4s
=> ERROR [build 6/16] RUN bundle install 1.2s

[build 6/16] RUN bundle install:
#10 1.161 Could not locate Gemfile


executor failed running [/bin/sh -c bundle install]: exit code: 10

<<Request>> Add media keys (play / stop / next ...) - any workaround?

Hi

Looks like media keys (play / stop / next ...) are not supported yet.

Please please please add them :D

Is there any workaround in the meantime to add media keys?

In the keymap.rb file, I tried to just add the decimal number for MediaPlayPause (179) instead of a named keycode, but it crashed.
https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.keys?view=windowsdesktop-6.0

kbd.add_layer :default, %i[ KC_ESC KC_1 KC_2 179 KC_4 ... ]

Thank you very much!

Split function and direct pins don't work together (version 0.9.10)

Hi,

For a split keyboard I want to use two RPi-Pico's and use the normal UART communication between them.
I'm testing with one empty Pico board.
With "kbd.set_anchor(:left)" or "(:right)" I define which side the Pico should be. When I use a matrix and init_pins the anchor works. But when I use direct pins (init_direct_pins) it always acts as the left side, even after setting the anchor to (:right).

I attached my testing code.

PS: I'm working with 0.9.10 since 0.9.11 doesn't support direct pins yet.

keymap direct.rb.txt
keymap matrix.rb.txt

<<Request>> long-press operation

I want to activate different key codes by long-press and short-press

It is an operation that is not found in a normal PC keyboard, but it is a popular operation in embedded systems.
It can be used for careful operations and infrequent operations.

Thank you for the wonderful environment for me!
画像 30

Mouse keys

Keys that work on PRK:

Symbol Alias
:KC_MS_UP :KC_MS_U Move cursor up
:KC_MS_DOWN :KC_MS_D Move cursor down
:KC_MS_LEFT :KC_MS_L Move cursor left
:KC_MS_RIGHT :KC_MS_R Move cursor right
:KC_MS_BTN1 :KC_BTN1 Press button 1
:KC_MS_BTN2 :KC_BTN2 Press button 2
:KC_MS_BTN3 :KC_BTN3 Press button 3
:KC_MS_BTN4 :KC_BTN4 Press button 4
:KC_MS_BTN5 :KC_BTN5 Press button 5
:KC_MS_WH_UP :KC_WH_U Move wheel up
:KC_MS_WH_DOWN :KC_WH_D Move wheel down
:KC_MS_WH_LEFT :KC_WH_L Move wheel left
:KC_MS_WH_RIGHT :KC_WH_R Move wheel right

referenced from https://github.com/qmk/qmk_firmware/blob/master/docs/feature_mouse_keys.md

report descriptor: https://github.com/hathach/tinyusb/blob/master/src/class/hid/hid_device.h#L221-L267

Input is looped.

I am not familiar with the PRK Firmware specifications, but the input is currently looping.

code:

kbd.add_layer :default, %i(
  L_adjst  KC_1     KC_2     KC_3     KC_4     KC_5     KC_6     KC_7     KC_8     KC_9     KC_0     KC_MINUS KC_EQUAL KC_BSPC
  KC_TAB   KC_Q     KC_W     KC_E     KC_R     KC_T     KC_Y     KC_U     KC_I     KC_O     KC_P     KC_LBRC  KC_RBRC  KC_BSLS
  KC_LCTL  KC_A     KC_S     KC_D     KC_F     KC_G     KC_H     KC_J     KC_K     KC_L     KC_SCOLON KC_QUOT KC_ENT   XXXXXXX
  KC_LSFT  KC_Z     KC_X     KC_C     KC_V     KC_B     KC_N     KC_M     KC_COMM  KC_DOT   KC_SLSH  KC_RSFT  KC_UP    XXXXXXX
  XXXXXXX  XXXXXXX  KC_LGUI  KC_LALT  L_raise  KC_SPC   XXXXXXX  L_lower  XXXXXXX  KC_RALT  KC_RGUI  KC_LEFT  KC_DOWN  KC_RGHT
)
kbd.add_layer :raise, %i(
  XXXXXXX  KC_F1    KC_F2    KC_F3    KC_F4    KC_F5    KC_F6    KC_F7    KC_F8    KC_F9    KC_F10   KC_F11   KC_F12   KC_DEL
  KC_TAB   XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX
  KC_LCTL  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX
  KC_LSFT  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  XXXXXXX  KC_RSFT  KC_HOME  XXXXXXX
  XXXXXXX  XXXXXXX  KC_LGUI  KC_LALT  XXXXXXX  KC_SPC   XXXXXXX  KC_SPC   XXXXXXX  KC_RALT  KC_RGUI  KC_PGUP  KC_END   KC_PGDN
)

kbd.define_mode_key :L_raise, [:KC_LANG1,  :raise,     200,    200 ]
kbd.define_mode_key :L_lower, [:KC_LANG2,  :lower,     200,    200 ]

I will use my code as a reference.
When I press L_lower while holding down the L_raise key, I can type KC_SPC.

At this time I can actually type Space, but when I release L_lower, Space continues to be typed.

Is this a spec behavior?

Builds via Docker will not load onto the microcontroller

When I download the most recent tagged release, 0.9.14 it works perfectly on my two Seeed XIAO RP2040 boards.

I am quite excited by PRK and interested in poking at the source (and hopefully sending in some pull requests!). I can successfully run the tests and build the latest few commits to master with the Docker image. Unfortunately, when I load the built uf2 file onto either of my boards, the board will not mount the PRKFirmware volume. Unfortunately it seems something is corrupted in the uf2? (Thankfully I can reboot the board back into bootsel mode and load the 0.9.14 firmware again.)

I am running a Mac with Intel Core i5 processor. Here's what I'm doing:

git checkout master
git pull master
rake deep_clean
docker compose build
docker compose run --rm prk rake setup
docker compose run --rm prk rake
# steep checks pass
# tests pass
# binaries are successfully built
# ...
# [100%] Linking CXX executable prk_firmware-0.9.14-20220629-d921fc5.elf
#   adding: prk_firmware-0.9.14-20220629-d921fc5.uf2 (deflated 73%)
# [100%] Built target prk_firmware-0.9.14-20220629-d921fc5

ls build
# ... lots of things ...
# prk_firmware-0.9.14-20220629-d921fc5.uf2

# πŸ‘‰πŸ”˜ Reboot Seed XIAO RP2040 into bootsel mode
# Drag-and-drop flash_nuke.uf2 to /Volumes/RPI-RP2
# volume unmounts, then mounts again

# Drag-and-drop prk_firmware-0.9.14-20220629-d921fc5.uf2 onto the RPI-RP2 volume
# The volume unmounts and then nothing happens.

Please let me know if I can provide any other details. Thank you!

Request: Debug print improvements

Is it possible to improve the debug print on the "USB Serial Port" so that the version of PRK Firmware can be displayed?
(as long as it does not affect the firmware boot speed)

image

CAPSLOCK etc.

Going to implement a callback so you can write like...

kbd = Keyboard.new
kbd.output_report_changed do |output|
  if output & Keyboard::CAPSLOCK > 1
    gpio_put ANY_PIN, any_value
    # or # $rgb.effect = :something
    # or # @oled.show(:something) # Though OLED is not implemented yet
  else
    gpio_put ANY_PIN, opposite_value
  end
  if output & Keyboard::NUMLOCK > 1
    # do something
  end
end

(This API design is still just an idea)

πŸ›Wrong keycode when layer and modifier are combined

ref: https://twitter.com/otahinosame/status/1478291637143216129

There are two bugs:

Bug 1

  • Layer change key pushed ​&& Modifier key pushed
  • Then, the layer change key released
  • Then a key tapped

Actual

A keycode that is modified on the "changed" layer is going to be reported.

Expectation

A keycode that is modified on the default layer should be reported.

Bug 2

If pressing a normal key followed by the layer change key quickly:

Actual

Both "the keycode of the first key" and "a keycode of the changed layer on the same key switch" will be reported.

Expectation

Only "the keycode of the first key" should be reported.

rgb.max_value Keymap.rb - error shown

Hello,
I have followed the tutorial at
https://github.com/picoruby/prk_firmware/wiki/RGBLED

when attempting to set
rgb.max_value = 30 # 1-31 / default: 13
in keymap.rb

I get an error in the Diagnostics Terminal

Undefined local variable or method 'max_value=' for RGB

is it possible that the tutorial has an error?
rgb.max_value should be rgb.value

ie. the code for RGB -
src/ruby/sig/rgb.rbs

has
def hue=: (Integer) -> void
def saturation=: (Integer) -> void
def value=: (Integer) -> void

the tutorial would expect this to be
def max_value=: (Integer) -> void

Request: Combos

Combos are a popular feature in other keyboard firmwares like QMK and KMK which let you chord two keypresses together to perform an action. For example: press A and B together within a 50ms period and you will send C. If the timer times out, the user releases a combo key within its timeout, or the user presses another key that would not match with a chord, the original keypress will be sent instead. The timeout should be user-configurable to account for differences in dexterity, preferably defined individually for each combo.

QMK page on combos
KMK page on combos

Roadmap for Mutual UART?

Hello! I am very interested to design a 3x5 split keyboard for PRK using Seeed XIAO RP2040 boards. I'm also a big fan of LEDs, and therefore would like to have mutual communication between the two halves.

I see that PRK currently has experimental support for mutual UART over a single wire, and have read through the code and seen the warnings that it works but is potentially dangerous. Do you plan to continue to develop mutual communication over a single wire? Or will you use two wires in the future? Perhaps it is not known right now?

The reason I ask is, the XIAO RP2040 has exactly enough pins for a normal matrix, one led pin, and one uart pin. If two pins are needed for mutual uart in the future, then I would need to use a duplex matrix for the switches to have enough pins. So this is a design decision that I will need to make fairly early.

Thank you for this project! I'm very excited to use Ruby for this project!

Composite key with Alias does not works

Environment

  • Version: v0.9.12
  • Hardware: same as #51
  • keymap.rb
puts "== DEBUG PAD =="

# Initialize a Keyboard
kbd = Keyboard.new

# Initialize GPIO assign
kbd.init_pins(
  [ 27 ], # row0, row1,... respectively
  [ 6,7,8,9 ]  # col0, col1,... respectively
)

kbd.add_layer :default, %i(
  KC_A SELECT_ALL BACK_LONG BACK_SHORT
)

kbd.define_composite_key :SELECT_ALL, %i(KC_LGUI KC_A)
kbd.define_composite_key :BACK_LONG,  %i(KC_LGUI KC_LBRACKET)
kbd.define_composite_key :BACK_SHORT, %i(KC_LGUI KC_LBRC)

kbd.start!

How to reproduce

  1. tap BACK_LONG => It works πŸ™†β€β™‚οΈ
  2. tap BACK_SHORT => Nothing reported πŸ€”

When tap BACK_SHORT, errors was printed.

debug print:

Suspending keymap.
Trying to reload keymap.
keymap.rb found.
== DEBUG PAD ==
Initializing Keyboard.
Initializing GPIO.
Starting keyboard task ...
Undefined local variable or method '+' for NilClass
Undefined local variable or method '*' for NilCUndefined local variable or method '+' for NilClass
Undefined local variable or method '*' for NilCUndefined local variable or method '+' for NilClass
Undefined local variable or method '*' for NilCUndefined local variable or method '+' for NilClass
Undefined local variable or method '*' for NilCUndefined local variable or method '+' for NilClass
Undefined local variable or method '*' for NilC

Support?

I could not find any official/proper support channels, so I am opening an issue here. If this is not the right place, I am sorry. Let me know where the right place is, and I will take my request there.

I have a hand-wired matrix with an inconsistent number of keys on each row, and column. The keyboard itself is/will be just a TKL.

Layout:
Screen Shot 2022-02-27 at 3 38 38 PM

Matrix:
Screen Shot 2022-02-27 at 3 51 27 PM

keycap.rb:
https://gist.github.com/igreulich/66b6f1168c312e3c95f6d82c332d86db

When I put the keymap.rb file on my Pico, the board does not work. I can connect to it via serial port, but it looks like it never fully loads. However the board does send input to the computer, at present it sends this input with out me pressing a key, and it is constant. (Currently the input seems to be ~ and [TAB].

I did put KC_NO in place where there is no key in the matrix, but I don't know if the fact that there is no coordinates (from the perspective of the matrix) at those locations is breaking something?

I am concerned I have put the diodes on backwards, and that the fact that all of my rows don't have the same number of keys are my sticking points. However, I don't know enough to even know what all I don't know.

Thanks in advanced for any help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.