Skip to content

Latest commit

 

History

History
169 lines (136 loc) · 3.52 KB

ergodone_richardc.org

File metadata and controls

169 lines (136 loc) · 3.52 KB

ergodone:richardc

Build me

#!/bin/sh
set -e
set -x
QMK=~/src/qmk_firmware

mkdir -p $QMK/keyboards/ergodone/keymaps/richardc
org2qmk ergodone_richardc.org keymap > $QMK/keyboards/ergodone/keymaps/richardc/keymap.c
(cd $QMK && make ergodone:richardc)

mkdir -p $QMK/keyboards/ergodox_ez/keymaps/richardc
org2qmk ergodone_richardc.org keymap > $QMK/keyboards/ergodox_ez/keymaps/richardc/keymap.c
(cd $QMK && make ergodox_ez:richardc)

C preamble

#include QMK_KEYBOARD_H
#include "version.h"

enum custom_keycodes {
		      PLACEHOLDER = SAFE_RANGE, // can always be here
		      EPRM,
		      VRSN,
		      RGB_SLD
};

Keyboard Layers

layer 0

Left Hand

`12345noop
tabqwertnoop
escapeasdfg
shift_lzxcvbnoop
TT(1)ctrl_lalt_lcmd_lnoop
noopnoop
noop
spaceenterdelete

Right Hand

-67890backspace
=yuiopenter
hjkl;\
noopnm,./shift_r
TT(1)[]ctrl_l
homeend
pgup
pgdnenterspace

layer 1 arrow keys, mouse stuff

Left Hand

””””””””””””””
””””””””””””””
””””””””””””
””””””””””””””
””””””””””
””””
””
””””””

Right Hand

””””””””””””EPRM
””””””””””””””
leftdownupright””””
””””””””””””””
””””””””””
””””
””
””””””

C postamble

process_record_user

process_record_user lets you wire up custom keycodes. Default enables EPRM, VRSN, and RGB_SLD keys.

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  switch (keycode) {
    // dynamically generate these.
  case EPRM:
    if (record->event.pressed) {
      eeconfig_init();
    }
    return false;
    break;
  case VRSN:
    if (record->event.pressed) {
      SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
    }
    return false;
    break;
  case RGB_SLD:
    if (record->event.pressed) {
#ifdef RGBLIGHT_ENABLE
      rgblight_mode(1);
#endif
    }
    return false;
    break;
  }
  return true;
}

matrix_init_user

matrix_init_user happens when the key matrix is setup, nothing special here by default.

// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {

};

matrix_scan_user

matrix_scan_user is used to light the indicator leds to indicate layer you’re in.

// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {

  uint8_t layer = biton32(layer_state);

  ergodox_board_led_off();
  ergodox_right_led_1_off();
  ergodox_right_led_2_off();
  ergodox_right_led_3_off();
  switch (layer) {
    // TODO: Make this relevant to the ErgoDox EZ.
  case 1:
    ergodox_right_led_1_on();
    break;
  case 2:
    ergodox_right_led_2_on();
    break;
  default:
    // none
    break;
  }
};