Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Zweihander layout for the Ergodox EZ #18737

Merged
merged 11 commits into from
Jan 16, 2023
Prev Previous commit
Next Next commit
Add \n- functionality to L1-v
  • Loading branch information
adiabatic committed Oct 25, 2022
commit 60c8e80e3db34dc1d2688c530eb989f186f00ccf
20 changes: 19 additions & 1 deletion layouts/community/ergodox/zweihander-macos/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@

// Best viewed in Xcode in Menlo Regular or SF Mono.

enum custom_keycodes {
NEWITEM = SAFE_RANGE,
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case NEWITEM:
if (record->event.pressed) {
// when keycode NEWITEM is pressed
SEND_STRING("\n- "); // starts a new item in a Markdown-style list
} else {
// when keycode NEWITEM is released
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this part, and can be removed.

Suggested change
} else {
// when keycode NEWITEM is released

Copy link
Contributor Author

@adiabatic adiabatic Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can understand why people would want to remove a do-nothing else clause, but I hate to remove it entirely without a trace, especially in a codebase that I'm likely to be permanently unfamiliar with (along with most keyboard-layout authors). I've removed it in 7dd0c4f, but left in a comment explaining what an else clause would be useful for. What do you think of it now?

}
break;
}
return true; // the key press we just processed should continue to be processed as normal
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer
*
Expand Down Expand Up @@ -79,7 +97,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
KC_TRNS,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_DQT ,KC_TRNS,
KC_TRNS,KC_LABK,KC_RABK,KC_LPRN,KC_RPRN,KC_QUOT,
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_EQL ,KC_TRNS,
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,NEWITEM,KC_EQL ,KC_TRNS,
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
KC_TRNS,KC_TRNS,
KC_TRNS,
Expand Down
10 changes: 8 additions & 2 deletions layouts/community/ergodox/zweihander-macos/readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,18 @@ All the common spreadsheet operations (+-*/=) are on the right side of the Symbo

Have you looked at the Page Up, Page Down, Home, and End keys on the EDSF keys and wondered why they’re arranged that way? They’re arranged the same way as the fn-key shortcuts on an Apple laptop’s arrow keys. On Apple keyboards with an\* fn key, if you press fn-↑, you’ll get Page Up; if you press fn-← you’ll get Home. Similarly, on Zweihander, ;-E is Page Up and ;-S is Home.

## write a fair bit of Markdown

If you’re on the second layer (hold/tap one of the four inside middle top keys), the `'` button on the far right is a `\`` key.

If you’re on the second layer, pressing `v` will send the string `"\n- "`, not including the quotation marks. This is intended to be a faster way to make a new list item when writing meeting notes in Markdown.

## use Siri

F16, accessed by holding ; and pressing the ' key next to it, is intended for Siri.

\* I pronounce “fn” as “effin’”. Your mileage may vary.

## use it with an iPad

This layout overrides `USB_MAX_POWER_CONSUMPTION` to turn it down to 100 mA instead of the default of 500 mA. This is not what you want if your Ergodox EZ has the Shine or Glow lights, but good if you want to be able to plug it into your iPad’s lightning port with a USB adapter. The indicator lights that tell you what layer you’re on are _not_ Shine or Glow lights.

\* I pronounce “fn” as “effin’”. Your mileage may vary.