ah- / anne-key

Firmware for Anne Pro Keyboard written in Rust
Apache License 2.0
567 stars 32 forks source link

Ascii art #12

Closed hdhoang closed 6 years ago

hdhoang commented 6 years ago

Tomorrow I can unpin nightly in this PR too, to avoid too much churn.

ah- commented 6 years ago

+1 for the emacs gitignore, I like that.

Something like the below (with better key alignment, was lazy) would be fun macro abuse, but I'm not quite sure if it's worth spending the time on:

pub const BASE: Layout = layout![
  ,-----------------------------------------------------------------------------------------------------------.
  | Escape   | N1    | N2   | N3 | N4 | N5    | N6 | N7 | N8    | N9  | N0     | Minus    | Equal    | BSpace |
  |-----------------------------------------------------------------------------------------------------------|
  | Tab      | Q     | W    | E  | R  | T     | Y  | U  | I     | O   | P      | LBracket | RBracket | BSlash |
  |-----------------------------------------------------------------------------------------------------------|
  | Capslock      | A   | S   | D   | F   | G   | H   | J   | K   | L    | SColon | Quote   |          Enter  |
  |-----------------------------------------------------------------------------------------------------------|
  | LShift     | Z     | X    | C    | V    | B     | N    | M    | Comma | Dot | Slash  |             RShift |
  |-----------------------------------------------------------------------------------------------------------|
  | LCtrl    | LMeta | LAlt |                Space                    | RAlt   | FN_M     | BT_T     | LED_M  |
  `-----------------------------------------------------------------------------------------------------------'
];

In practice it's probably not worth it, with longer and more meaningful Action codes it'll all shift around anyways.

hdhoang commented 6 years ago

I will close this PR, and split out the gitignore bit. Do you think book.* should be skipped by CI? That can go along.

The main hurdle I had with ASCII-art characters is that they are matched by expr. The name-only keys/actions can be matched with $key: ident, and I'll try adding an $action:ident ( $value:tt ) pattern to cover for the struct actions. We also need to insert No actions automatically too.

15 introduced short aliases for actions, so mis-alignment should be resolved. I care much about the layout editing capability, so misplacing keys on the rectangular grid saddened me :-1: (besides #14, I also misplaced HTN's arrows).

Is there some other area I can hack on without soldering on debug headers? We should expand the hacking section for different contributor profiles.

ah- commented 6 years ago

I've got a whole list of To-dos at home, will post some tonight.

ah- commented 6 years ago

I've added a bunch of them to https://github.com/ah-/anne-key/issues, hope there's something interesting in there for you.

Some of them like https://github.com/ah-/anne-key/issues/27 are pretty doable (and testable) with just Rust.