jthlim / javelin-steno

Embedded Steno Engine
Other
63 stars 10 forks source link

Add Colemak-DH to keyboard layouts #9

Closed jjpaq closed 10 months ago

jjpaq commented 10 months ago

Hi Jeffrey, love your work on Javelin and looking forward to using it when I get my Polyglot. 🙂

I've been using Colemak-DH alongside steno for almost a year now and was hoping to add Colemak-DH support to Javelin. If you're not familiar, it's a variant on Colemak that's frequently recommended for being more ergonomic, especially the D and H keys.

It's only a few keys different from Colemak, but I took the liberty of putting together a layout table to save you some time (though of course it's not the only change needed to add a layout).

I did see the discussion on #3, so didn't put together a pull request, but if you're busy or otherwise accepting PRs now I can try to do that instead.

Please let me know if this would be possible to add! Zero rush, of course, and thanks for all your work.

const KeyboardLayoutTable COLEMAK_DH_LAYOUT_TABLE = {
  .values = {
    0, 1, 2, 3,
    KeyCode::A, KeyCode::T, KeyCode::C, KeyCode::V, // A-D
    KeyCode::K, KeyCode::E, KeyCode::G, KeyCode::M, // E-H
    KeyCode::L, KeyCode::Y, KeyCode::N, KeyCode::U, // I-L
    KeyCode::H, KeyCode::J, KeyCode::SEMICOLON, KeyCode::R, // M-P
    KeyCode::Q, KeyCode::S, KeyCode::D, KeyCode::F, // Q-T
    KeyCode::I, KeyCode::B, KeyCode::W, KeyCode::X, // U-X
    KeyCode::O, KeyCode::Z, 30, 31, // Y-Z, 1-2
    32, 33, 34, 35, 36, 37, 38, 39,
    40, 41, 42, 43, 44, 45, 46, 47,
    48, 49, 50, KeyCode::P, 52, 53, 54, 55, // Semicolon -> P
    56, 57, 58, 59, 60, 61, 62, 63,
  }
};
jthlim commented 10 months ago

Just checking - are you aware of the difference between keyboard layouts and button scripts in javelin?

Keyboard layouts are used when you want to connect to a computer that isn't set to QWERTY, and want the steno engine to output something -- so it knows that "A" doesn't actually mean "A". It doesn't make the QWERTY layout suddenly work as a Colemak layout, or any other layout.

On the other hand, button scripts are used to define that pressing a particular button should do something - press a key typically, but there's more things that it can do - and is how you'd typically set up your steno keyboard with a different layout.

An example polyglot script is here

I was on the verge of removing keyboard layouts from javelin, as they seem to cause more confusion, and make it much, much harder to just plug your keyboard into another computer/phone/tablet and have it work as you expect.

jjpaq commented 10 months ago

Ohh, I understand now, I was approaching it like QMK and thinking the layouts remap physical buttons to letters in QWERTY mode. In my defense, it was pretty late at night. 😅

Yeah, my computer is still set to QWERTY so emitting the standard scan codes will work fine in steno mode, I'm just trying to customize the QWERTY mode layout.

Looks like I should be creating a .javelin-script file with updated onPress functions for each alpha key, or even an additional custom layer if possible. (It's nice to still have a QWERTY layer for gaming, since it saves remapping all the controls.)

Am I right in thinking that the Button Script tool will allow flashing a new layout this way?

Thank you for explaining so clearly.

jthlim commented 10 months ago

Yup, you're exactly right!

Just need to start with one of the polyglot files (there's a few different configuration options in that directory), then either select it as the button script when you create the firmware, or use the button script tool to upload to your keyboard!