Author Topic: keybrd firmware library for Arduino  (Read 4430 times)

0 Members and 1 Guest are viewing this topic.

Offline wolfv

  • Thread Starter
  • Posts: 269
keybrd firmware library for Arduino
« on: Fri, 22 July 2016, 14:38:12 »
This thread is for keybrd library: project guidance, technical support, and bug reports.
I hope to get questions and feedback from the keyboard community.

NEED HELP?
When asking a technical question, please provide enough information for us to help!
 * Complete sketch (copy & paste, attachment, or a link to the code)
 * Screenshot or the exact text of error messages
 * Describe the observed behavior and explain which behavior you expected
 * Which controller your using
 * Wiring details - how exactly have you connected the hardware (a photo's worth 1000 words)
 * Arduino IDE version number
 * keybrd library version number
 * Any other information needed to reproduce the problem...

RESOURCES
The keybrd library is freely available through GitHub and the Arduino Library Manager.

README
tutorials
keybrd_library_user_guide
keybrd_library_developer_guide
CONTRIBUTING.md
    Improvement suggestions
    Bug reports
    Code contributions
    User contributions
    Submitting a pull request
CHANGELOG
PLANNED_FEATURES
« Last Edit: Wed, 28 September 2016, 01:01:35 by wolfv »

Offline wolfv

  • Thread Starter
  • Posts: 269
New additions
« Reply #1 on: Fri, 22 July 2016, 14:38:40 »
NEW ADDITIONS
keybrd version 0.6.0 (2016-09-28)
 * Shift registers
 * I/O expander MCP23S17
 * tutorial_3cde_sublayer_keyboard
 * tutorial_4_connecting_split_keyboards
 * tutorial_4b_split_keyboard_with_shift_registers
 * tutorial_4c_split_keyboard_with_IOE
 * tutorial_5b_LED_on_IOE

« Last Edit: Wed, 28 September 2016, 17:02:01 by wolfv »

Offline joey

  • Posts: 2296
  • Location: UK
Re: keybrd firmware library
« Reply #2 on: Fri, 22 July 2016, 15:10:02 »
Interesting, you gave each 'action' a class.
I implemented the same thing in my firmware, but then threw it away for the 'encoding' style that TMK uses.

I had a few issues with it, one being related to static global objects and their constructors that weren't being removed when unused.
The class solution allows you to not compile code when it's not used by the keymap. You can emulate that with defines for the 'encoding' technique, but it's not so clean. Eventually I'll experiment and see if I can find a solution that works 'automagically' for the 'encoding' technique.


Offline wolfv

  • Thread Starter
  • Posts: 269
Re: keybrd firmware library
« Reply #3 on: Fri, 22 July 2016, 15:35:33 »
Hi Joey.

What you mean by "action"?
Each key is an object, and each key has a press() and release() action.

Offline joey

  • Posts: 2296
  • Location: UK
Re: keybrd firmware library
« Reply #4 on: Fri, 22 July 2016, 15:56:04 »
Hi Joey.

What you mean by "action"?
Each key is an object, and each key has a press() and release() action.
I meant the Code classes.

Offline wolfv

  • Thread Starter
  • Posts: 269
Re: keybrd firmware library
« Reply #5 on: Fri, 22 July 2016, 16:22:29 »
Hi Joey.

What you mean by "action"?
Each key is an object, and each key has a press() and release() action.
I meant the Code classes.

Yup. The keybrd library has 14 types of Code.  Single-layer keyboards would only use Code_Sc.
The other 13 Codes are specialized for multi-layer keyboards.

Offline energie

  • Posts: 3
Re: keybrd firmware library for Arduino
« Reply #6 on: Sun, 12 March 2017, 13:53:06 »
Hi wolfv,

I'm fairly new at programming and stumbled upon your code. I'm interested in implementing a shift key with a toggle feature similar to caps-locks. Any idea on how to tackle this?

Offline wolfv

  • Thread Starter
  • Posts: 269
Re: keybrd firmware library for Arduino
« Reply #7 on: Sun, 12 March 2017, 15:02:04 »
Welcome to the forum energie.

Just to make sure I understand your requirements:
Quote
Toggle MODIFIERKEY_LEFT_SHIFT between press and release by tapping a key named "toggle-shift".
To the user, the behavior appears similar to CapsLock, but it would shift all letters, numbers, keypad, and modifiers like ctrl+shift (CapsLock only effects letters).
Is that what you want?

Offline energie

  • Posts: 3
Re: keybrd firmware library for Arduino
« Reply #8 on: Wed, 15 March 2017, 02:33:01 »
Hi wolfv,

Thank you for the warm welcome!

Actually, I used the wrong word. The shift key isn't really a toggle but rather just remaining active for the next keystroke.

For example, after pressing the toggle-shift, the next keystroke (letter or number) will have the alternative character show on screen. Then the shift function is not active anymore for the next keystroke.

This is so that the user doesn't have to hold down the shift key to make the letter capitol or input a symbol.

Offline wolfv

  • Thread Starter
  • Posts: 269
Re: keybrd firmware library for Arduino
« Reply #9 on: Wed, 15 March 2017, 10:06:28 »
The shift key isn't really a toggle but rather just remaining active for the next keystroke.

For example, after pressing the toggle-shift, the next keystroke (letter or number) will have the alternative character show on screen. Then the shift function is not active anymore for the next keystroke.

This is so that the user doesn't have to hold down the shift key to make the letter capitol or input a symbol.

That sounds like a "sticky key" feature.  https://en.wikipedia.org/wiki/Sticky_keys
Sticky keys can be activated on most operating systems.
A stickyKey class could also be added to the keybrd firmware library.

"sticky keys" is mentioned in https://github.com/wolfv6/keybrd/blob/master/src/Row.cpp
Sticky mouse buttons are implemented in keybrd_DH firmware https://github.com/wolfv6/keybrd_DH
A stickyKey class would be similar.

Offline energie

  • Posts: 3
Re: keybrd firmware library for Arduino
« Reply #10 on: Tue, 21 March 2017, 00:12:38 »
Thanks for the reply wolfv.

Sticky keys is a good solution. Thanks for pointing that out, I never knew what the function of sticky keys were.