picoruby / prk_firmware

A keyboard firmware platform in PicoRuby
MIT License
573 stars 53 forks source link

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

Open SekoiaTree opened 2 years ago

SekoiaTree commented 2 years ago

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.

hasumikin commented 2 years ago

Let me think for a while...