forked from mirror/qmk_firmware
crkbd layout
This commit is contained in:
36
users/allemangd/allemangd.c
Normal file
36
users/allemangd/allemangd.c
Normal file
@@ -0,0 +1,36 @@
|
||||
#include "allemangd.h"
|
||||
|
||||
#define PRESS (record->event.pressed)
|
||||
#define RELEASE (!record->event.pressed)
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case KC_VRSN:
|
||||
return PRESS && vrsn();
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool vrsn() {
|
||||
SEND_STRING(
|
||||
QMK_KEYBOARD
|
||||
":"
|
||||
QMK_KEYMAP
|
||||
" ("
|
||||
QMK_VERSION
|
||||
" @ "
|
||||
QMK_BUILDDATE
|
||||
")"
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) {
|
||||
return state;
|
||||
}
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
|
||||
return layer_state_set_keymap(state);
|
||||
}
|
||||
81
users/allemangd/allemangd.h
Normal file
81
users/allemangd/allemangd.h
Normal file
@@ -0,0 +1,81 @@
|
||||
#ifndef USERSPACE
|
||||
#define USERSPACE
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "version.h"
|
||||
|
||||
void my_custom_function(void);
|
||||
|
||||
enum userspace_layers {
|
||||
_DVORAK = 0,
|
||||
_LOWER,
|
||||
_RAISE,
|
||||
_ADJUST,
|
||||
_MOUSE,
|
||||
};
|
||||
|
||||
#define ET_LWER LT(_LOWER, KC_ENTER)
|
||||
#define SP_RAIS LT(_RAISE, KC_SPC)
|
||||
#define DL_LALT MT(MOD_LALT, KC_DEL)
|
||||
#define IN_RALT MT(MOD_RALT, KC_INS)
|
||||
#define AP_RCTL MT(MOD_RCTL, KC_APP)
|
||||
|
||||
#if defined(KEYMAP_SAFE_RANGE)
|
||||
# define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE
|
||||
#else
|
||||
# define PLACEHOLDER_SAFE_RANGE SAFE_RANGE
|
||||
#endif
|
||||
|
||||
enum userspace_custom_keycodes {
|
||||
KC_VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info
|
||||
NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes
|
||||
};
|
||||
|
||||
bool vrsn(void);
|
||||
|
||||
// clang-format off
|
||||
|
||||
// todo LGUI_T in DVORAK_L3, DVORAK_R3
|
||||
|
||||
#define __BLANK____________________________________ _______, _______, _______, _______, _______
|
||||
|
||||
#define LG_SCLN LGUI_T(KC_SCLN)
|
||||
#define RG_Z RGUI_T(KC_Z)
|
||||
|
||||
#define __DVORAK_L1________________________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y
|
||||
#define __DVORAK_L2________________________________ KC_A, KC_O, KC_E, KC_U, KC_I
|
||||
#define __DVORAK_L3________________________________ LG_SCLN, KC_Q, KC_J, KC_K, KC_X
|
||||
|
||||
#define __DVORAK_R1________________________________ KC_F, KC_G, KC_C, KC_R, KC_L
|
||||
#define __DVORAK_R2________________________________ KC_D, KC_H, KC_T, KC_N, KC_S
|
||||
#define __DVORAK_R3________________________________ KC_B, KC_M, KC_W, KC_V, RG_Z
|
||||
|
||||
#define __LOWER_L1_________________________________ KC_1, KC_2, KC_3, KC_4, KC_5
|
||||
#define __LOWER_L2_________________________________ KC_6, KC_7, KC_8, KC_9, KC_0
|
||||
#define __LOWER_L3_________________________________ _______, _______, _______, _______, _______
|
||||
|
||||
#define __LOWER_R1_________________________________ _______, KC_SLSH, KC_EQL, KC_BSLS, KC_QUES
|
||||
#define __LOWER_R2_________________________________ _______, KC_LBRC, KC_LPRN, KC_RPRN, KC_RBRC
|
||||
#define __LOWER_R3_________________________________ _______, _______, _______, _______, _______
|
||||
|
||||
#define __RAISE_L1_________________________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC
|
||||
#define __RAISE_L2_________________________________ KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_CIRC
|
||||
#define __RAISE_L3_________________________________ KC_SCLN, _______, _______, KC_AMPR, KC_PIPE
|
||||
|
||||
#define __RAISE_R1_________________________________ _______, _______, KC_UP, _______, _______
|
||||
#define __RAISE_R2_________________________________ _______, KC_LEFT, KC_DOWN, KC_RGHT, _______
|
||||
#define __RAISE_R3_________________________________ _______, _______, _______, _______, _______
|
||||
|
||||
#define __ADJUST_L1________________________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5
|
||||
#define __ADJUST_L2________________________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10
|
||||
#define __ADJUST_L3________________________________ KC_F11, KC_F12, KC_F13, KC_F14, KC_F15
|
||||
|
||||
#define __ADJUST_R1________________________________ KC_MUTE, _______, KC_PGUP, _______, _______
|
||||
#define __ADJUST_R2________________________________ KC_VOLU, KC_HOME, KC_PGDN, KC_END, _______
|
||||
#define __ADJUST_R3________________________________ KC_VOLD, KC_MPRV, KC_MPLY, KC_MNXT, _______
|
||||
|
||||
// clang-format on
|
||||
|
||||
#endif
|
||||
14
users/allemangd/readme.md
Normal file
14
users/allemangd/readme.md
Normal file
@@ -0,0 +1,14 @@
|
||||
Copyright <year> <name> <email> @<github_username>
|
||||
|
||||
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/>.
|
||||
1
users/allemangd/rules.mk
Normal file
1
users/allemangd/rules.mk
Normal file
@@ -0,0 +1 @@
|
||||
SRC += allemangd.c
|
||||
Reference in New Issue
Block a user