forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addded initial changes needed for full-screen 4 line display in vis l…
…ibrary for infinity ergodox.
- Loading branch information
Showing
10 changed files
with
353 additions
and
49 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
## aenertia's modified ergodox infinity layout | ||
|
||
## Uses a kinesis like layout with some modifications from 333fred's layout/vis | ||
|
||
|
||
##notes | ||
|
||
Uses a modified viz library from the main qmk and differing ugfx compile time options to enable wordwrap and 4 line output on the 128x32 LCD | ||
|
||
Currently I am only testing on a Single RightHand PCB - as Massdrop/Input Club shipped me two Right hand sides. | ||
|
||
In theory just compiling two different visualization.c for the left and right should be fine. But I am not sure about the the async code in qmk and can't currently test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef CONFIG_H_ | ||
#define CONFIG_H_ | ||
|
||
#include QMK_KEYBOARD_CONFIG_H | ||
|
||
#undef TAPPING_TERM | ||
#define TAPPING_TERM 150 | ||
|
||
#define PERMISSIVE_HOLD | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
#include QMK_KEYBOARD_H | ||
#include "debug.h" | ||
#include "action_layer.h" | ||
#include "version.h" | ||
|
||
#define BASE 0 // default layer | ||
#define SYMB 1 // symbols | ||
#define MDIA 2 // media keys | ||
|
||
enum custom_keycodes { | ||
PLACEHOLDER = SAFE_RANGE, // can always be here | ||
EPRM, | ||
VRSN, | ||
}; | ||
|
||
enum custom_macros { | ||
VERSION, | ||
EEPROM, | ||
}; | ||
|
||
// NOTE: Cells marked with ACCESS must remain transparent, they're the keys that actually get to that layer | ||
|
||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
/* Keymap 0: Basic layer | ||
* | ||
* ,--------------------------------------------------. ,--------------------------------------------------. | ||
* | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | | ||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
* | Tab | Q | W | E | R | T | L1 | |ACCESS| Y | U | I | O | P | \ | | ||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
* | Caps | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | | ||
* |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| | ||
* | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | | ||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
* | Esc | Grv |Insert| Left | Right| | Up | Down | [ | ] | L2 | | ||
* `----------------------------------' `----------------------------------' | ||
* ,-------------. ,-------------. | ||
* | Ctrl | Alt | | LGui | Ctrl | | ||
* ,------|------|------| |------+------+------. | ||
* | | | Home | | PgUp | | | | ||
* |Backsp| Del |------| |------| Enter| Space| | ||
* |ace | | End | | PgDn | | | | ||
* `--------------------' `--------------------' | ||
*/ | ||
// If it accepts an argument (i.e, is a function), it doesn't need KC_. | ||
// Otherwise, it needs KC_* | ||
[BASE] = LAYOUT_ergodox( // layer 0 : default | ||
// left hand | ||
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, | ||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), | ||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, | ||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), | ||
KC_ESC, KC_GRV, KC_INS, KC_LEFT, KC_RGHT, | ||
KC_LCTL,KC_LALT, | ||
KC_HOME, | ||
KC_BSPC,KC_DEL,KC_END, | ||
// right hand | ||
KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, | ||
TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, | ||
KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, | ||
KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN2, | ||
KC_LGUI, KC_RCTL, | ||
KC_PGUP, | ||
KC_PGDN, KC_ENT, KC_SPC | ||
), | ||
/* Keymap 1: Symbol Layer | ||
* | ||
* ,--------------------------------------------------. ,--------------------------------------------------. | ||
* | PrScr | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | | ||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
* | ScrLk | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | | ||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
* | Pause | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + |VERSION | | ||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
* | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | | ||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
* | | | | | | | | . | 0 | = | | | ||
* `----------------------------------' `----------------------------------' | ||
* ,-------------. ,-------------. | ||
* | | | | | | | ||
* ,------|------|------| |------+------+------. | ||
* | | | | | | | | | ||
* | | |------| |------| | | | ||
* | | | | | | | | | ||
* `--------------------' `--------------------' | ||
*/ | ||
// SYMBOLS | ||
[SYMB] = LAYOUT_ergodox( | ||
// left hand | ||
KC_PSCR,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, | ||
KC_SLCK,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, | ||
KC_PAUS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, | ||
KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, | ||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, | ||
KC_TRNS,KC_TRNS, | ||
KC_TRNS, | ||
KC_TRNS,KC_TRNS,KC_TRNS, | ||
// right hand | ||
KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, | ||
KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, | ||
KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, VRSN, | ||
MO(MDIA), KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, | ||
KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, | ||
KC_TRNS, KC_TRNS, | ||
KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS | ||
), | ||
|
||
/* Keymap 2: Media and mouse keys | ||
* | ||
* ,--------------------------------------------------. ,--------------------------------------------------. | ||
* | | | | | | | | | | | | | | | | | ||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
* | | | | MsUp | | | | | | | | | | | | | ||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
* | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | | ||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
* | | | | | | | | | | | | Prev | Next | | | | ||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
* | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | | ||
* `----------------------------------' `----------------------------------' | ||
* ,-------------. ,-------------. | ||
* | | | | | | | ||
* ,------|------|------| |------+------+------. | ||
* | | | | | | |Brwser| | ||
* | | |------| |------| |Back | | ||
* | | | | | | | | | ||
* `--------------------' `--------------------' | ||
*/ | ||
// MEDIA AND MOUSE | ||
[MDIA] = LAYOUT_ergodox( | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, | ||
KC_TRNS, KC_TRNS, | ||
KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, | ||
// right hand | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, | ||
KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, | ||
KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_WBAK | ||
), | ||
}; | ||
|
||
const uint16_t PROGMEM fn_actions[] = { | ||
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) | ||
}; | ||
|
||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | ||
{ | ||
// MACRODOWN only works in this function | ||
switch(id) { | ||
case VERSION: | ||
if (record->event.pressed) { | ||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); | ||
} | ||
break; | ||
case EEPROM: | ||
if (record->event.pressed) { // For resetting EEPROM | ||
eeconfig_init(); | ||
} | ||
break; | ||
} | ||
return MACRO_NONE; | ||
}; | ||
|
||
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; | ||
} | ||
return true; | ||
} | ||
|
||
// Runs just one time when the keyboard initializes. | ||
void matrix_init_user(void) { | ||
|
||
}; | ||
|
||
|
||
// Runs constantly in the background, in a loop. | ||
void matrix_scan_user(void) { | ||
ergodox_board_led_on(); | ||
ergodox_led_all_on(); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
LCD_BACKLIGHT_ENABLE = yes | ||
LCD_ENABLE = yes | ||
BACKLIGHT_ENABLE = yes | ||
NKRO_ENABLE = yes | ||
KEY_LOCK_ENABLE = yes | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
Note: this is a modified copy of ../default/visualizer.c, originally licensed GPL. | ||
*/ | ||
|
||
#include "simple_visualizer.h" | ||
|
||
// This function should be implemented by the keymap visualizer | ||
// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing | ||
// that the simple_visualizer assumes that you are updating | ||
// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is | ||
// stopped. This can be done by either double buffering it or by using constant strings | ||
// Default - !#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwx"; | ||
// | ||
// This has expanded with the quantum visualizer and ugfx lib to use the GDrawStringBox api rather than Drawstring and wordwrap enabled | ||
// The following block renders 4 lines on the screen with fixed 5x8 font and using wordwrap | ||
// Spaces/Null space is a bit hit or miss so Try and use this format when entering your layer strings \t and \n are pretty hit or miss | ||
/* | ||
"Gu Ct Ri 6 7 8 9 0 - " | ||
"Pu En Sp l1 Y U I O P \\ " | ||
"Pd Me H J K L ; ' " | ||
"U D [ ] l2 N M , . / Sh "; | ||
*/ | ||
static void get_visualizer_layer_and_color(visualizer_state_t* state) { | ||
uint8_t saturation = 60; | ||
if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) { | ||
saturation = 255; | ||
} | ||
if (state->status.layer & 0x10) { | ||
state->target_lcd_color = LCD_COLOR(140, 100, 60); | ||
state->layer_text = "Movement"; | ||
} else if (state->status.layer & 0x8) { | ||
state->target_lcd_color = LCD_COLOR(0, saturation, 0xFF); | ||
state->layer_text = "Media"; | ||
} else if (state->status.layer & 0x4) { | ||
state->target_lcd_color = LCD_COLOR(168, saturation, 0xFF); | ||
state->layer_text = | ||
"Ra Rc l1 6 7 8 9 0 - " | ||
"Pu En Bb l2 Y U I O P \\ " | ||
"Pd Me H J K L ; Play " | ||
"V+ V- Vm l2 N M Pr Ne "; | ||
} else if (state->status.layer & 0x2) { | ||
state->target_lcd_color = LCD_COLOR(216, 90, 0xFF); | ||
state->layer_text = | ||
"Funct: Ri 6 7 8 9 10 11 " | ||
"Pu En Sp l1 7 8 9 * F12 " | ||
"Pd Me 4 5 6 + Ver " | ||
"0 0 . = l2 & 1 2 3 \\ Sh "; | ||
} else { | ||
state->target_lcd_color = LCD_COLOR(84, saturation, 0xFF); | ||
state->layer_text = | ||
"Gu Ct Ri 6 7 8 9 0 - " | ||
"Pu En Sp l1 Y U I O P \\ " | ||
"Pd Me H J K L ; ' " | ||
"U D [ ] l2 N M , . / Sh "; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.