Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7874f297b3 | ||
|
|
3541f01a72 | ||
|
|
eae21eed74 | ||
|
|
e62ab7e259 | ||
|
|
0270d4d5a1 |
No files matched your search
@@ -114,7 +114,15 @@ Two more deprecated functions exist that provide the LED state as a `uint8_t`:
|
|||||||
|
|
||||||
This function will be called when the state of one of those 5 LEDs changes. It receives the LED state as a struct parameter.
|
This function will be called when the state of one of those 5 LEDs changes. It receives the LED state as a struct parameter.
|
||||||
|
|
||||||
You must return either `true` or `false` from this function, depending on whether you want to override the keyboard-level implementation.
|
By convention, return `true` from `led_update_user()` to get the `led_update_kb()` hook to run its code, and
|
||||||
|
return `false` when you would prefer not to run the code in `led_update_kb()`.
|
||||||
|
|
||||||
|
Some examples include:
|
||||||
|
|
||||||
|
- overriding the LEDs to use them for something else like layer indication
|
||||||
|
- return `false` because you do not want the `_kb()` function to run, as it would override your layer behavior.
|
||||||
|
- play a sound when an LED turns on or off.
|
||||||
|
- return `true` because you want the `_kb` function to run, and this is in addition to the default LED behavior.
|
||||||
|
|
||||||
?> Because the `led_set_*` functions return `void` instead of `bool`, they do not allow for overriding the keyboard LED control, and thus it's recommended to use `led_update_*` instead.
|
?> Because the `led_set_*` functions return `void` instead of `bool`, they do not allow for overriding the keyboard LED control, and thus it's recommended to use `led_update_*` instead.
|
||||||
|
|
||||||
@@ -122,66 +130,41 @@ You must return either `true` or `false` from this function, depending on whethe
|
|||||||
|
|
||||||
```c
|
```c
|
||||||
bool led_update_kb(led_t led_state) {
|
bool led_update_kb(led_t led_state) {
|
||||||
if(led_update_user(led_state)) {
|
bool res = led_update_user(led_state);
|
||||||
if (led_state.num_lock) {
|
if(res) {
|
||||||
writePinLow(B0);
|
// writePin sets the pin high for 1 and low for 0.
|
||||||
} else {
|
// In this example the pins are inverted, setting
|
||||||
writePinHigh(B0);
|
// it low/0 turns it on, and high/1 turns the LED off.
|
||||||
}
|
// This behavior depends on whether the LED is between the pin
|
||||||
if (led_state.caps_lock) {
|
// and VCC or the pin and GND.
|
||||||
writePinLow(B1);
|
writePin(B0, !led_state.num_lock);
|
||||||
} else {
|
writePin(B1, !led_state.caps_lock);
|
||||||
writePinHigh(B1);
|
writePin(B2, !led_state.scroll_lock);
|
||||||
}
|
writePin(B3, !led_state.compose);
|
||||||
if (led_state.scroll_lock) {
|
writePin(B4, !led_state.kana);
|
||||||
writePinLow(B2);
|
|
||||||
} else {
|
|
||||||
writePinHigh(B2);
|
|
||||||
}
|
|
||||||
if (led_state.compose) {
|
|
||||||
writePinLow(B3);
|
|
||||||
} else {
|
|
||||||
writePinHigh(B3);
|
|
||||||
}
|
|
||||||
if (led_state.kana) {
|
|
||||||
writePinLow(B4);
|
|
||||||
} else {
|
|
||||||
writePinHigh(B4);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example `led_update_user()` Implementation
|
### Example `led_update_user()` Implementation
|
||||||
|
|
||||||
|
This incomplete example would play a sound if Caps Lock is turned on or off. It returns `true`, because you also want the LEDs to maintain their state.
|
||||||
|
|
||||||
```c
|
```c
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
float caps_on[][2] = SONG(CAPS_LOCK_ON_SOUND);
|
||||||
|
float caps_off[][2] = SONG(CAPS_LOCK_OFF_SOUND);
|
||||||
|
#endif
|
||||||
|
|
||||||
bool led_update_user(led_t led_state) {
|
bool led_update_user(led_t led_state) {
|
||||||
if (led_state.num_lock) {
|
#ifdef AUDIO_ENABLE
|
||||||
writePinLow(B0);
|
static uint8_t caps_state = 0;
|
||||||
} else {
|
if (caps_state != led_state.caps_lock) {
|
||||||
writePinHigh(B0);
|
led_state.caps_lock ? PLAY_SONG(caps_on) : PLAY_SONG(caps_off);
|
||||||
}
|
caps_state = led_state.caps_lock;
|
||||||
if (led_state.caps_lock) {
|
|
||||||
writePinLow(B1);
|
|
||||||
} else {
|
|
||||||
writePinHigh(B1);
|
|
||||||
}
|
|
||||||
if (led_state.scroll_lock) {
|
|
||||||
writePinLow(B2);
|
|
||||||
} else {
|
|
||||||
writePinHigh(B2);
|
|
||||||
}
|
|
||||||
if (led_state.compose) {
|
|
||||||
writePinLow(B3);
|
|
||||||
} else {
|
|
||||||
writePinHigh(B3);
|
|
||||||
}
|
|
||||||
if (led_state.kana) {
|
|
||||||
writePinLow(B4);
|
|
||||||
} else {
|
|
||||||
writePinHigh(B4);
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -411,7 +394,7 @@ void keyboard_post_init_user(void) {
|
|||||||
// Set default layer, if enabled
|
// Set default layer, if enabled
|
||||||
if (user_config.rgb_layer_change) {
|
if (user_config.rgb_layer_change) {
|
||||||
rgblight_enable_noeeprom();
|
rgblight_enable_noeeprom();
|
||||||
rgblight_sethsv_noeeprom_cyan();
|
rgblight_sethsv_noeeprom_cyan();
|
||||||
rgblight_mode_noeeprom(1);
|
rgblight_mode_noeeprom(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -459,18 +442,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
}
|
}
|
||||||
return true; // Let QMK send the enter press/release events
|
return true; // Let QMK send the enter press/release events
|
||||||
case RGB_LYR: // This allows me to use underglow as layer indication, or as normal
|
case RGB_LYR: // This allows me to use underglow as layer indication, or as normal
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
user_config.rgb_layer_change ^= 1; // Toggles the status
|
user_config.rgb_layer_change ^= 1; // Toggles the status
|
||||||
eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM
|
eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM
|
||||||
if (user_config.rgb_layer_change) { // if layer state indication is enabled,
|
if (user_config.rgb_layer_change) { // if layer state indication is enabled,
|
||||||
layer_state_set(layer_state); // then immediately update the layer color
|
layer_state_set(layer_state); // then immediately update the layer color
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false; break;
|
return false; break;
|
||||||
case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // For any of the RGB codes (see quantum_keycodes.h, L400 for reference)
|
case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // For any of the RGB codes (see quantum_keycodes.h, L400 for reference)
|
||||||
if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled
|
if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled
|
||||||
if (user_config.rgb_layer_change) { // only if this is enabled
|
if (user_config.rgb_layer_change) { // only if this is enabled
|
||||||
user_config.rgb_layer_change = false; // disable it, and
|
user_config.rgb_layer_change = false; // disable it, and
|
||||||
eeconfig_update_user(user_config.raw); // write the setings to EEPROM
|
eeconfig_update_user(user_config.raw); // write the setings to EEPROM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -483,7 +466,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
And lastly, you want to add the `eeconfig_init_user` function, so that when the EEPROM is reset, you can specify default values, and even custom actions. To force an EEPROM reset, use the `EEP_RST` keycode or [Bootmagic](feature_bootmagic.md) functionallity. For example, if you want to set rgb layer indication by default, and save the default valued.
|
And lastly, you want to add the `eeconfig_init_user` function, so that when the EEPROM is reset, you can specify default values, and even custom actions. To force an EEPROM reset, use the `EEP_RST` keycode or [Bootmagic](feature_bootmagic.md) functionallity. For example, if you want to set rgb layer indication by default, and save the default valued.
|
||||||
|
|
||||||
```c
|
```c
|
||||||
void eeconfig_init_user(void) { // EEPROM is getting reset!
|
void eeconfig_init_user(void) { // EEPROM is getting reset!
|
||||||
user_config.raw = 0;
|
user_config.raw = 0;
|
||||||
user_config.rgb_layer_change = true; // We want this enabled by default
|
user_config.rgb_layer_change = true; // We want this enabled by default
|
||||||
eeconfig_update_user(user_config.raw); // Write default value to EEPROM now
|
eeconfig_update_user(user_config.raw); // Write default value to EEPROM now
|
||||||
@@ -508,7 +491,7 @@ The `val` is the value of the data that you want to write to EEPROM. And the `e
|
|||||||
|
|
||||||
By default, the tapping term is defined globally, and is not configurable by key. For most users, this is perfectly fine. But in come cases, dual function keys would be greatly improved by different timeouts than `LT` keys, or because some keys may be easier to hold than others. Instead of using custom key codes for each, this allows for per key configurable `TAPPING_TERM`.
|
By default, the tapping term is defined globally, and is not configurable by key. For most users, this is perfectly fine. But in come cases, dual function keys would be greatly improved by different timeouts than `LT` keys, or because some keys may be easier to hold than others. Instead of using custom key codes for each, this allows for per key configurable `TAPPING_TERM`.
|
||||||
|
|
||||||
To enable this functionality, you need to add `#define TAPPING_TERM_PER_KEY` to your `config.h`, first.
|
To enable this functionality, you need to add `#define TAPPING_TERM_PER_KEY` to your `config.h`, first.
|
||||||
|
|
||||||
|
|
||||||
## Example `get_tapping_term` Implementation
|
## Example `get_tapping_term` Implementation
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
/* Copyright 2019 Danny Nguyen <[email protected]>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
#define _AUDACITY 0
|
||||||
|
#define _LIGHTS 1
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
|
AUDACITY = SAFE_RANGE,
|
||||||
|
LIGHTS,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define KC_ KC_TRNS
|
||||||
|
#define KC_AUD AUDACITY
|
||||||
|
#define KC_LITE LIGHTS
|
||||||
|
#define KC_ZNRM LCTL(KC_2) // zoom normal
|
||||||
|
#define KC_SAVE LCTL(KC_S) // save
|
||||||
|
#define KC_SYNC LALT(KC_S) // sync-lock tracks
|
||||||
|
#define KC_SLNC LCTL(KC_L) // silence selection
|
||||||
|
#define KC_BL_S BL_STEP
|
||||||
|
#define KC_RGBM RGB_MOD
|
||||||
|
#define KC_RGBT RGB_TOG
|
||||||
|
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
/*
|
||||||
|
| Knob 1: Vol Dn/Up | | Knob 2: Page Dn/Up |
|
||||||
|
| Press: Mute | Home | Press: Play/Pause |
|
||||||
|
| Hold: Layer 2 | Up | RGB Mode |
|
||||||
|
| Left | Down | Right |
|
||||||
|
*/
|
||||||
|
[_AUDACITY] = LAYOUT(
|
||||||
|
//,-------+-------+-------.
|
||||||
|
KC_LITE,KC_SAVE,KC_ZNRM,
|
||||||
|
//|-------+-------+-------|
|
||||||
|
KC_SYNC,KC_SLNC,KC_BSPC,
|
||||||
|
//|-------+-------+-------|
|
||||||
|
KC_SPC , KC_F1 , KC_F2
|
||||||
|
//`-------+-------+-------'
|
||||||
|
),
|
||||||
|
/*
|
||||||
|
| RESET | N/A | Media Stop |
|
||||||
|
| Held: Layer 2 | Home | RGB Mode |
|
||||||
|
| Media Previous | End | Media Next |
|
||||||
|
*/
|
||||||
|
[_LIGHTS] = LAYOUT(
|
||||||
|
//,-------+-------+-------.
|
||||||
|
KC_ ,KC_BL_S,KC_STOP,
|
||||||
|
//|-------+-------+-------|
|
||||||
|
KC_RGBM,KC_HOME,KC_RGBT,
|
||||||
|
//|-------+-------+-------|
|
||||||
|
KC_MPRV,KC_END ,KC_MNXT
|
||||||
|
//`-------+-------+-------'
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
|
if (index == 0) {
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_RGHT);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_LEFT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (index == 1) {
|
||||||
|
if (clockwise) {
|
||||||
|
SEND_STRING(SS_LCTRL("1")); // audacity zoom in
|
||||||
|
} else {
|
||||||
|
SEND_STRING(SS_LCTRL("3")); // audacity zoom out
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2017 Danny Nguyen <[email protected]>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
/* Use I2C or Serial, not both */
|
||||||
|
|
||||||
|
#define USE_SERIAL
|
||||||
|
// #define USE_I2C
|
||||||
|
|
||||||
|
/* Select hand configuration */
|
||||||
|
|
||||||
|
#define MASTER_LEFT
|
||||||
|
// #define MASTER_RIGHT
|
||||||
|
// #define EE_HANDS
|
||||||
|
|
||||||
|
#define TAPPING_TERM 150
|
||||||
|
|
||||||
|
#define TAPPING_TOGGLE 2
|
||||||
|
#define PERMISSIVE_HOLD
|
||||||
|
|
||||||
|
#undef RGBLED_NUM
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLED_NUM 12
|
||||||
|
#define RGBLIGHT_HUE_STEP 8
|
||||||
|
#define RGBLIGHT_SAT_STEP 8
|
||||||
|
#define RGBLIGHT_VAL_STEP 8
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
enum layer_names {
|
||||||
|
_QWERTY,
|
||||||
|
_LOWER,
|
||||||
|
_RAISE,
|
||||||
|
_ADJUST,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
|
LOWER = SAFE_RANGE,
|
||||||
|
RAISE,
|
||||||
|
ADJUST,
|
||||||
|
GUSR,
|
||||||
|
HGRP,
|
||||||
|
CHUS,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define KC_ KC_TRNS
|
||||||
|
|
||||||
|
#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen
|
||||||
|
#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen
|
||||||
|
#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen
|
||||||
|
#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen
|
||||||
|
#define KC_ESCC MT(MOD_LCTL, KC_ESC)
|
||||||
|
#define KC_LOWR LOWER
|
||||||
|
#define KC_RASE RAISE
|
||||||
|
#define KC_RST RESET
|
||||||
|
#define KC_BL_S BL_STEP
|
||||||
|
|
||||||
|
// Left and right shift as mot-tap square braces
|
||||||
|
#define KC_LSBR MT(MOD_LSFT, KC_LBRC)
|
||||||
|
#define KC_RSBR MT(MOD_RSFT, KC_RBRC)
|
||||||
|
|
||||||
|
// mod-tap shift/minus
|
||||||
|
#define KC_SMIN MT(MOD_LSFT, KC_MINS)
|
||||||
|
|
||||||
|
// Tap-toggle layers
|
||||||
|
#define KC_TT_L TT(1)
|
||||||
|
#define KC_TT_R TT(2)
|
||||||
|
|
||||||
|
#define KC_RGBM RGB_MOD
|
||||||
|
#define KC_RGBT RGB_TOG
|
||||||
|
|
||||||
|
#define KC_SLOK LGUI(LCTL(KC_Q)) // mojave lock screen
|
||||||
|
#define KC_GUSR GUSR // "gam info user" macro
|
||||||
|
#define KC_HGRP HGRP // "history | grep" macro
|
||||||
|
#define KC_CHUS CHUS // "thisisunsafe" chrome browser macro
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
[_QWERTY] = LAYOUT_kc(
|
||||||
|
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||||
|
GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
TAB , Q , W , E , R , T , Y , U , I , O , P ,BSLS,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
ESC , A , S , D , F , G , H , J , K , L ,SCLN,QUOT,
|
||||||
|
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
|
||||||
|
LSBR, Z , X , C , V , B ,TT_L, TT_R, N , M ,COMM,DOT ,SLSH,RSBR,
|
||||||
|
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
|
||||||
|
LCTL,SMIN,LGUI, ENT ,SPC ,LALT
|
||||||
|
// `----+----+----' `----+----+----'
|
||||||
|
),
|
||||||
|
|
||||||
|
[_LOWER] = LAYOUT_kc(
|
||||||
|
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||||
|
TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,MINS,EQL , ,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
,SLOK, , UP , ,RGBT, P7 , P8 , P9 , E , F ,LPRN,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
DEL , ,LEFT,DOWN,RGHT,GUSR, P4 , P5 , P6 , C , D ,RPRN,
|
||||||
|
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
|
||||||
|
BL_S, , , ,HGRP,CHUS, , , P1 , P2 , P3 , A , B , ,
|
||||||
|
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
|
||||||
|
, , , DOT , P0 ,COLN
|
||||||
|
// `----+----+----' `----+----+----'
|
||||||
|
),
|
||||||
|
|
||||||
|
[_RAISE] = LAYOUT_kc(
|
||||||
|
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||||
|
F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
,RGBT,RGBM, , , , ,AMPR,MUTE, , , ,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
,CAPW,CPYW,CAPP,CPYP,PGUP, EQL ,HOME,VOLU,MRWD,MFFD, ,
|
||||||
|
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
|
||||||
|
, , , , ,PGDN, , ,PLUS,END ,VOLD,MPLY,MSTP, ,
|
||||||
|
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
|
||||||
|
, , , , ,
|
||||||
|
// `----+----+----' `----+----+----'
|
||||||
|
),
|
||||||
|
|
||||||
|
[_ADJUST] = LAYOUT(
|
||||||
|
//,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------.
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||||
|
RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||||
|
RESET , DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
//|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------|
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
//`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------'
|
||||||
|
_______, _______, _______, _______, _______, _______
|
||||||
|
// `--------+--------+--------' `--------+--------+--------'
|
||||||
|
)
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case LOWER:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
layer_on(_LOWER);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
} else {
|
||||||
|
layer_off(_LOWER);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case RAISE:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
layer_on(_RAISE);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
} else {
|
||||||
|
layer_off(_RAISE);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case ADJUST:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
layer_on(_ADJUST);
|
||||||
|
} else {
|
||||||
|
layer_off(_ADJUST);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case GUSR:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("gam info user ");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case HGRP:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("history|grep ");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CHUS:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("thisisunsafe");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# HBBisenieks' Iris Layout
|
||||||
|
|
||||||
|
A modified Iris layout with toggle-tap layers and a hexidecimal
|
||||||
|
numpad. Other features include Space-Cadet-like shift keys that can do
|
||||||
|
square or curly braces and a home-row escape key.
|
||||||
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
RGBLIGHT_ENABLE = yes
|
||||||
|
BACKLIGHT_ENABLE = yes
|
||||||
|
|
||||||
|
# Comment out for pro-micro board
|
||||||
|
BOOTLOADER = atmel-dfu
|
||||||
|
|
||||||
@@ -22,3 +22,33 @@ RGB_RMOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
|||||||
_______, KC_LALT, _______, _______, _______, KC_RALT, _______ \
|
_______, KC_LALT, _______, _______, _______, KC_RALT, _______ \
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef USE_LEDS_FOR_LAYERS
|
||||||
|
// example of how to use LEDs as layer indicators
|
||||||
|
static uint8_t top = 1;
|
||||||
|
static uint8_t middle = 0;
|
||||||
|
static uint8_t bottom = 0;
|
||||||
|
|
||||||
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
|
top = middle = bottom = 0;
|
||||||
|
switch (get_highest_layer(state)) {
|
||||||
|
case _BASE:
|
||||||
|
top = 1;
|
||||||
|
break;
|
||||||
|
case _FUNC:
|
||||||
|
middle = 1;
|
||||||
|
break;
|
||||||
|
default: // for any other layers, or the default layer
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
// override kb level function
|
||||||
|
bool led_update_user(led_t usb_led) {
|
||||||
|
writePin(B1, !top);
|
||||||
|
writePin(B2, !middle);
|
||||||
|
writePin(B3, !bottom);
|
||||||
|
return false; // we are using LEDs for something else override kb
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "wonderland.h"
|
#include "wonderland.h"
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
void matrix_init_kb(void) {
|
void matrix_init_kb(void) {
|
||||||
// put your keyboard start-up code here
|
// put your keyboard start-up code here
|
||||||
// runs once when the firmware starts up
|
// runs once when the firmware starts up
|
||||||
@@ -7,12 +8,14 @@ void matrix_init_kb(void) {
|
|||||||
led_init_ports();
|
led_init_ports();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
void matrix_scan_kb(void) {
|
void matrix_scan_kb(void) {
|
||||||
// put your looping keyboard code here
|
// put your looping keyboard code here
|
||||||
// runs every cycle (a lot)
|
// runs every cycle (a lot)
|
||||||
matrix_scan_user();
|
matrix_scan_user();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
void led_init_ports(void) {
|
void led_init_ports(void) {
|
||||||
// * Set our LED pins as output
|
// * Set our LED pins as output
|
||||||
setPinOutput(B1);
|
setPinOutput(B1);
|
||||||
@@ -20,23 +23,12 @@ void led_init_ports(void) {
|
|||||||
setPinOutput(B3);
|
setPinOutput(B3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void led_set_kb(uint8_t usb_led) {
|
bool led_update_kb(led_t led_state) {
|
||||||
if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
|
bool runDefault = led_update_user(led_state);
|
||||||
writePinLow(B1);
|
if (runDefault) {
|
||||||
} else {
|
writePin(B1, !led_state.num_lock);
|
||||||
writePinHigh(B1);
|
writePin(B2, !led_state.caps_lock);
|
||||||
|
writePin(B3, !led_state.scroll_lock);
|
||||||
}
|
}
|
||||||
|
return runDefault;
|
||||||
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
|
|
||||||
writePinLow(B2);
|
|
||||||
} else {
|
|
||||||
writePinHigh(B2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) {
|
|
||||||
writePinLow(B3);
|
|
||||||
} else {
|
|
||||||
writePinHigh(B3);
|
|
||||||
}
|
|
||||||
led_set_user(usb_led);
|
|
||||||
}
|
}
|
||||||
@@ -3,3 +3,5 @@
|
|||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
#define STARTUP_SONG SONG(DVORAK_SOUND)
|
#define STARTUP_SONG SONG(DVORAK_SOUND)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 5
|
||||||
+1
-1
@@ -321,7 +321,7 @@ extcoff: $(BUILD_DIR)/$(TARGET).elf
|
|||||||
bootloader:
|
bootloader:
|
||||||
make -C lib/lufa/Bootloaders/DFU/ clean
|
make -C lib/lufa/Bootloaders/DFU/ clean
|
||||||
$(TMK_DIR)/make_dfu_header.sh $(ALL_CONFIGS)
|
$(TMK_DIR)/make_dfu_header.sh $(ALL_CONFIGS)
|
||||||
$(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne '/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0))
|
$(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0))
|
||||||
$(eval PROGRAM_SIZE_KB=$(shell n=`expr $(MAX_SIZE) / 1024` && echo $$(($$n)) || echo 0))
|
$(eval PROGRAM_SIZE_KB=$(shell n=`expr $(MAX_SIZE) / 1024` && echo $$(($$n)) || echo 0))
|
||||||
$(eval BOOT_SECTION_SIZE_KB=$(shell n=`expr $(BOOTLOADER_SIZE) / 1024` && echo $$(($$n)) || echo 0))
|
$(eval BOOT_SECTION_SIZE_KB=$(shell n=`expr $(BOOTLOADER_SIZE) / 1024` && echo $$(($$n)) || echo 0))
|
||||||
$(eval FLASH_SIZE_KB=$(shell n=`expr $(PROGRAM_SIZE_KB) + $(BOOT_SECTION_SIZE_KB)` && echo $$(($$n)) || echo 0))
|
$(eval FLASH_SIZE_KB=$(shell n=`expr $(PROGRAM_SIZE_KB) + $(BOOT_SECTION_SIZE_KB)` && echo $$(($$n)) || echo 0))
|
||||||
|
|||||||
+1
-1
@@ -397,7 +397,7 @@ ifeq ($(findstring avr-gcc,$(CC)),avr-gcc)
|
|||||||
SIZE_MARGIN = 1024
|
SIZE_MARGIN = 1024
|
||||||
|
|
||||||
check-size:
|
check-size:
|
||||||
$(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne '/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0))
|
$(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0))
|
||||||
$(eval CURRENT_SIZE=$(shell if [ -f $(BUILD_DIR)/$(TARGET).hex ]; then $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(AWK) 'NR==2 {print $$4}'; else printf 0; fi))
|
$(eval CURRENT_SIZE=$(shell if [ -f $(BUILD_DIR)/$(TARGET).hex ]; then $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(AWK) 'NR==2 {print $$4}'; else printf 0; fi))
|
||||||
$(eval FREE_SIZE=$(shell expr $(MAX_SIZE) - $(CURRENT_SIZE)))
|
$(eval FREE_SIZE=$(shell expr $(MAX_SIZE) - $(CURRENT_SIZE)))
|
||||||
$(eval OVER_SIZE=$(shell expr $(CURRENT_SIZE) - $(MAX_SIZE)))
|
$(eval OVER_SIZE=$(shell expr $(CURRENT_SIZE) - $(MAX_SIZE)))
|
||||||
|
|||||||
Reference in new issue
Block a user