Compare commits

...

14 Commits

Author SHA1 Message Date
Jonathan Arnett
b07b4bb97b Alterations and documentation updates for j3rn Ergodox EZ keymap (#1656)
* Add second set of AltSft and Alt

* Insert the play key between previous and next

* Update documentation
2017-08-30 11:52:43 -04:00
David Stosik
5b897ce223 Port #1576 to Let's Split: EECONFIG_HANDEDNESS gets overridden when RGB is enabled 2017-08-30 11:51:58 -04:00
Otto Rask
da33dfec55 rask's Satan and BananaSplit60 (#1654)
* Add rask's Satan layout

* Add rask's Satan layout

* Add rask's BananaSplit60 layout

* Add rask's BS60 readme

* Fix rask's BS60 readme image

* Fix rask's BS60 readme image again
2017-08-30 11:51:18 -04:00
Michael Terhar
a4316ba486 Fixed mitosis-mjt audio (#1653)
* copied mjt keymaps from archive

* All mjt boards now compile

* fixed jd45-mjt breathing

* Updates to fix SpaceFN but not tested yet.

* Still missing either spacebar or an adjacent keypress.

* Debugging rigged up for use with hid_listen.

* Reverted the default keymap to use tap_layer_key rather than custom.  Moved custom approach to keymap_debug.c

* Fixed the lower-left side of the keymap, which needed more spacers due to the matrix being directly put into the array rather than using the keymap function.

* Cleaned up JD45 keymap that uses tapkey.

* Redid minivan keymap with numsym rather than raise/lower.
Untested.

* Created my MJT keymap for HHKB
Enabled dynamic macros and moved
somoe of the shortcuts around.

* Minor keymap fixes to make them compile without errors.

* Added home/end to right arrow cluster on DYN layer.

* Added more keys to fn and dyn layers.

* It wasn't using my custom layer last time somehow...?  Now it will.

* Compiled and installed at end of day on 8/23

* Moved macros to FKEY layer because Adjust was too hard to get into and out of without some sort of feedback.

* Fixed volume controls... were reversed and disabled.

* Added F13-F15 back to fkeys layer in Minivan

* Created new Planck Keymap that uses the NumSym and FKeys layer approach like the Minivan.

* Removed DYN layer.

* Fixed diagram in planck numsym.

* Cleanup for pull request.

* Roadkit flip phone warning.

* Replaced PLAY_NOTES_ARRAY to PLAY_SONG

* reset the submodules

* checked out specific commits for submodules

* Removed debugging from JD45 shared config.h

* Moved custom rules.mk to apropriate keymap

Reset the shared rules.mk file.

* Trailing return issue in rules.mk

Gotta make for a smooth pull request :-)

* Mitosis music troubleshooting

Also updated the song playing function.
Does not work currently.

* Fixed mitosis audio

* Put mitosis/rules.mk back to QMK master
2017-08-30 11:50:31 -04:00
Marco Fontani
da83f04a30 add UC_OSX_RALT to make unicode use the Right Alt key on OSX 2017-08-30 11:38:03 -04:00
drashna
9987f9dcff Update drashna's keymap (#1649)
* initial commit for my custom layout

* fix switching into and out of numfun layer

* enable tap dance to lock layers

* enable layer indicator LEDs

* remove Colemak2 layer because it was dumb

* remove handler for nonexistent keycode

* add new movement keys to lower layer

* standardize indentation because I'm not a monster

* add Woodpad keyboard with Michael's Tryggve layout

* Add dvorak/colemak layers

* add hash

* Update keymap.c

* Fixed OSL Symbol layer layout issue

* Minor later tweak

* Clean up actions

* Diablo 3 macro keys remove

* Fixed numbad issues

* Remove Underglow toggle

* Fix layer consistency

* cleanup of code

* line feed

* small fixes

* Major merge

* Merge cleanup on my keymap

* Cleanup

* Update compile command

* Swapped arrows

* Additional cleanup

* Revert "Woodpad"

* update

* minor update

* staging for pull request

* Finish removing layer underglow toggles
2017-08-30 11:36:14 -04:00
Fredric Silberberg
ad73553aa9 Update README. 2017-08-30 11:28:56 -04:00
Fredric Silberberg
00d8f0c082 Small gaming layer and formatting updates to my nyquist config. 2017-08-30 11:28:56 -04:00
Jack Humbert
a729d852fe Merge pull request #1574 from danamlund/master
New clueboard keymap that is a tetris game
2017-08-30 11:27:52 -04:00
Arthur SCHMITT
da7aece043 Add the new QMK submodule way in /lib and not tmk_core/tool wich is outdated 2017-08-30 11:26:24 -04:00
skullY
ed56a6859f add a git-submodule make target. 2017-08-28 11:26:35 -04:00
Jack Humbert
ba2ad57ca8 add rule shortcut via @samwho's suggesion 2017-08-27 12:53:35 -04:00
Jack Humbert
677b89768b add bin targets - closes #1648, fixes #1647 2017-08-27 12:11:59 -04:00
Dan Amlund Thomsen
4a9e16b394 Add a tetris keymap to clueboard that includes a tetris game 2017-08-17 18:13:21 +02:00
30 changed files with 1262 additions and 356 deletions

2
.gitignore vendored
View File

@@ -48,4 +48,4 @@ util/Win_Check_Output.txt
# things travis sees
secrets.tar
id_rsa_*
id_rsa_*

View File

@@ -551,6 +551,10 @@ test: test-all
.PHONY: test-clean
test-clean: test-all-clean
git-submodule:
git submodule sync --recursive
git submodule update --init --recursive
ifdef SKIP_VERSION
SKIP_GIT := yes
endif

View File

@@ -24,6 +24,7 @@ sort of like macro. Unfortunately, each OS has different ideas on how Unicode is
This is the current list of Unicode input method in QMK:
* UC_OSX: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex.
* UC_OSX_RALT: Same as UC_OSX, but sends the Rigt Alt key for unicode input
* UC_LNX: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else.
* UC_WIN: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead.
* UC_WINC: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows.

View File

@@ -0,0 +1,53 @@
# rask's BananaSplit60
![BS60 layout](http://i.imgur.com/Q7so1py.png)
## Notes
### Layers
Base layer is a regular HHKBish ANSI layer. Toggling the
alternate base layer (Fn3) makes it simpler to play games with
the left space being set to be an actual Space.
Layer 1 (Fn1) contains usual 60% functionalities such as the
F-row, while Layer 2 (Fn2) contains media controls.
The final layer (Fn4) is a special layer that acts as a lock
layer, meaning the keyboard is locked while the layer
is active. This firmware assumes a lock switch (read below).
### Lock switches
1.25u between the split space halves and the 1u key right
left of LeftArrow are to be operated with a lock switch.
If you don't have lock switches you should swap the `MO()`
calls with `TG()` calls to make the layer toggles work
with regular non/locking switches.
## How to make and flash
(These instructions are for Linux-based operating systems
with `dfu-programmer` available.)
`cd` into the `bananasplit` keyboard's directory and run
make rask
which should result in a file called `bananasplit_rask.hex` appearing
in your QMK root directory.
Now plug in your BananaSplit60 keyboard via USB. Verify
with `lsusb` that it appears. At least my PCB did not have
anything preflashed so you should see `atmega32u4` or similar
in the `lsusb` output.
Now you can flash the firmware by
$ sudo dfu-programmer atmega32u4 erase
$ cd /qmk_firmware/root/directory
$ sudo dfu-programmer atmega32u4 flash bananasplit_rask.hex
_If_ you happen to have some other `atmega32u4` based device
I suggest you plug it out before flashing your BS60 just to
prevent accidentally flashing your old device.

View File

@@ -0,0 +1,72 @@
#include "bananasplit.h"
// rask's BananaSplit60 layout
#define L_BASE 0
#define L_BASE_ALT 1
#define L_ONE 2
#define L_TWO 3
#define L_LOCK 4
#define ______ KC_TRNS
#define XXXXXX KC_NO
// L_BASE
// Initial layer with default keymap
//
// L_BASE_ALT
// Layer with some standardisation e.g. make
// space key "full" to make gaming less of a
// chore
//
// L_ONE
// General things like F-row and navigation
//
// L_TWO
// Media controls and more exotic keybinds
//
// L_LOCK
// Lock the keyboard, release to unlock
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[L_BASE] = KEYMAP_HHKB_ARROW( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \
MO(L_ONE), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, MT(MOD_RSFT, KC_SLSH), KC_UP, MO(L_TWO), \
KC_LCTRL, KC_LGUI, KC_LALT, KC_BSPC, MO(L_BASE_ALT), KC_SPACE, KC_RALT, MO(L_LOCK), KC_LEFT, KC_DOWN, KC_RIGHT \
),
[L_BASE_ALT] = KEYMAP_HHKB_ARROW( \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
______, ______, ______, KC_SPACE, ______, ______, ______, ______, ______, ______, ______ \
),
[L_ONE] = KEYMAP_HHKB_ARROW( \
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_PGUP, ______, \
______, ______, ______, ______, ______, ______, ______, ______, KC_HOME, KC_PGDN, KC_END \
),
[L_TWO] = KEYMAP_HHKB_ARROW( \
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MPRV, KC_MPLY, KC_MNXT, ______, ______, \
KC_CAPS, ______, ______, ______, ______, ______, ______, ______, ______, KC_VOLD, KC_VOLU, KC_MUTE, ______, \
______, ______, ______, ______, ______, ______, ______, ______, KC_MSTP, ______, ______, ______, ______, \
______, KC_APP, ______, ______, ______, ______, ______, ______, ______, ______, ______ \
),
[L_LOCK] = KEYMAP_HHKB_ARROW( \
XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, ______, XXXXXX, XXXXXX, XXXXXX \
),
};

View File

@@ -2,9 +2,24 @@
These ARM Teensies are now supported through [ChibiOS](http://chibios.org).
You'll need to install an ARM toolchain, for instance from [gcc ARM embedded](https://launchpad.net/gcc-arm-embedded) website, or using your favourite package manager. After installing, you should be able to run `arm-none-eabi-gcc -v` in the command prompt and get sensible output. This toolchain is used instead of `avr-gcc`, which is only for AVR chips. Naturally you'll also need the usual development tools (e.g. `make`), just as in the AVR setting.
## Installing the ARM toolchain
Next, you'll need ChibiOS. For Teensies, you'll need code from two repositories: [chibios-main](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS). If you're not using git, you can just download a [zip of chibios from here](https://github.com/ChibiOS/ChibiOS/archive/a7df9a891067621e8e1a5c2a2c0ceada82403afe.zip), unpack the zip, and rename/move the unpacked directory (named `ChibiOS-<long_hash_here>`) to `tmk_core/tool/chibios/chibios` (so that the file `tmk_core/tool/chibios/chibios/license.txt` exists). Now the same procedure with a [zip of chibios-contrib from here](https://github.com/ChibiOS/ChibiOS-Contrib/archive/e1311c4db6cd366cf760673f769e925741ac0ad3.zip): unpack and move `ChibiOS-Contrib-<long_hash_here>` to `tmk_core/tool/chibios/chibios-contrib`.
You'll need to install an ARM toolchain, there is now a nice documentation about the two AVR/ARM toolchain:https://docs.qmk.fm/getting_started_build_tools.html and you can just run `sudo util/install_dependencies.sh`.
This toolchain is used instead of `avr-gcc`, which is only for AVR chips. Naturally you'll also need the usual development tools (e.g. `make`), just as in the AVR setting.
You can find others way with the [gcc ARM embedded](https://launchpad.net/gcc-arm-embedded) website, or using your favourite package manager. After installing, you should be able to run `arm-none-eabi-gcc -v` in the command prompt and get sensible output.
## Installing ChibiOS
Next, you'll need ChibiOS. For Teensies, you'll need code from two repositories: [chibios-main](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS).
### If youre using git
Run `git submodule sync —recursive && git submodule update --init —recursive`. This will install ChibiOS and ChibiOS-Contrib in the `/lib/` directory.
### If youre not using Git
If you're not using git, you can just download a [zip of chibios from here](https://github.com/ChibiOS/ChibiOS/archive/a7df9a891067621e8e1a5c2a2c0ceada82403afe.zip), unpack the zip, and rename/move the unpacked directory (named `ChibiOS-<long_hash_here>`) to `lib/chibios/chibios` (so that the file `lib/chibios/chibios/license.txt` exists). Now the same procedure with a [zip of chibios-contrib from here](https://github.com/ChibiOS/ChibiOS-Contrib/archive/e1311c4db6cd366cf760673f769e925741ac0ad3.zip): unpack and move `ChibiOS-Contrib-<long_hash_here>` to `lib/chibios/chibios-contrib`.
(If you're using git, you can just clone the two repos: [chibios](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS-Contrib). However - be warned that things may be somewhat out-of-sync (updates at different rates), so you may need to hunt a bit for the right commits.)

View File

@@ -0,0 +1 @@
SRC = tetris_text.c

View File

@@ -0,0 +1,209 @@
#include "clueboard.h"
#include "tetris_text.h"
// Helpful defines
#define GRAVE_MODS (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
#define _______ KC_TRNS
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BL 0
#define _FL 1
#define _CL 2
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: Base Layer (Default Layer)
*/
[_BL] = KEYMAP(
F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC,KC_SPC, KC_HENK, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _FL: Function Layer
*/
[_FL] = KEYMAP(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, BL_STEP, \
_______, _______, _______,_______,_______,F(1) ,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, _______, _______, \
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, \
_______, _______, _______, _______, _______,_______, _______, _______, _______, MO(_FL), KC_HOME, KC_PGDN, KC_END),
/* Keymap _CL: Control layer
*/
[_CL] = KEYMAP(
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \
_______, _______, _______,_______,RESET, _______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_VAD, \
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, MO(_FL), RGB_SAI, \
_______, _______, _______,_______, RGB_MOD, RGB_MOD, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI),
};
/* This is a list of user defined functions. F(N) corresponds to item N
of this list.
*/
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(0), // Calls action_function()
[1] = ACTION_FUNCTION(1)
};
static uint8_t tetris_key_presses = 0;
static uint16_t tetris_timer = 0;
static uint8_t tetris_running = 0;
static int tetris_keypress = 0;
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t mods_pressed;
static bool mod_flag;
switch (id) {
case 0:
// clueboard specific hook to make escape quite tetris
if (tetris_running) {
tetris_running = 0;
return;
}
/* Handle the combined Grave/Esc key
*/
mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
if (record->event.pressed) {
/* The key is being pressed.
*/
if (mods_pressed) {
mod_flag = true;
add_key(KC_GRV);
send_keyboard_report();
} else {
add_key(KC_ESC);
send_keyboard_report();
}
} else {
/* The key is being released.
*/
if (mod_flag) {
mod_flag = false;
del_key(KC_GRV);
send_keyboard_report();
} else {
del_key(KC_ESC);
send_keyboard_report();
}
}
break;
case 1:
if (record->event.pressed) {
tetris_running = 1;
tetris_timer = 0;
tetris_keypress = 0;
// set randomness using total number of key presses
tetris_start(tetris_key_presses);
}
break;
}
}
/*
* Set up tetris
*/
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
tetris_key_presses++;
}
if (tetris_running && record->event.pressed) {
tetris_keypress = 0;
switch (keycode) {
case KC_UP: tetris_keypress = 1; break;
case KC_LEFT: tetris_keypress = 2; break;
case KC_DOWN: tetris_keypress = 3; break;
case KC_RIGHT: tetris_keypress = 4; break;
// Make ESC stop tetris (on keyboards other than clueboard)
// case KC_ESC: tetris_running = 0; return false;
}
if (tetris_keypress != 0) {
return false;
}
}
return true;
}
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
if (tetris_running) {
tetris_timer++;
if (tetris_timer > 1000) {
// every 1000 times this is run is about 100 ms.
if (!tetris_tick(100)) {
// game over
tetris_running = 0;
}
tetris_timer = 0;
}
}
}
void send_keycode(uint16_t keycode) {
register_code(keycode);
unregister_code(keycode);
}
void send_keycode_shift(uint16_t keycode) {
register_code(KC_LSFT);
register_code(keycode);
unregister_code(keycode);
unregister_code(KC_LSFT);
}
void tetris_send_up(void) {
send_keycode(KC_UP);
}
void tetris_send_left(void) {
send_keycode(KC_LEFT);
}
void tetris_send_down(void) {
send_keycode(KC_DOWN);
}
void tetris_send_right(void) {
send_keycode(KC_RGHT);
}
void tetris_send_backspace(void) {
send_keycode(KC_BSPC);
}
void tetris_send_delete(void) {
send_keycode(KC_DEL);
}
void tetris_send_string(const char *s) {
for (int i = 0; s[i] != 0; i++) {
if (s[i] >= 'a' && s[i] <= 'z') {
send_keycode(KC_A + (s[i] - 'a'));
} else if (s[i] >= 'A' && s[i] <= 'Z') {
send_keycode_shift(KC_A + (s[i] - 'A'));
} else if (s[i] >= '1' && s[i] <= '9') {
send_keycode(KC_1 + (s[i] - '1'));
} else {
switch (s[i]) {
case ' ': send_keycode(KC_SPACE); break;
case '.': send_keycode(KC_DOT); break;
case '0': send_keycode(KC_0); break;
}
}
}
}
void tetris_send_newline(void) {
send_keycode(KC_ENT);
}
int tetris_get_keypress(void) {
int out = tetris_keypress;
tetris_keypress = 0;
return out;
}

View File

@@ -0,0 +1,33 @@
Default layout but with a tetris game
=====================================
Tetris works by outputting key-presses to make ascii-art in a regular text editor.
It reads key presses to rotate and move the bricks like a regular tetris game.
Example
=======
![tetris](https://raw.githubusercontent.com/danamlund/meckb_tetris/master/tetris.gif)
Usage
=====
1) Open a default text editor
2) Press the tetris button (Fn + t)
3) Play tetris
It makes ascii-art by sending keycodes: left, right, up, down, qwerty characters, and numbers.
Problems
========
Drawing ascii-art is too slow to make a pleasant playing experience.
While drawing ascii-art, the keyboard does not record key-presses, so its pretty unresponsive.
Adds 5000 bytes to the hex file.
Implement in other keyboards
============================
- Copy-paste the files tetris_text.c and tetrix_text.h to your keymap folder.
- Add/update your-keyboard/your-keymap/Makefile to include ``SRC = tetris_text.c``
- Copy-paste the tetris-related code from this keymap.c to yours.
- Set a key to trigger F(1) to start tetris mode.
- Its also a good idea to set a key to stop tetris, here its escape.
You can find a simple tetris keyboard definition at <https://github.com/danamlund/meckb_tetris/>

View File

@@ -0,0 +1,505 @@
/* Copyright 2017 Dan Amlund Thomsen
*
* 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 <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdint.h>
#include "tetris_text.h"
static char empty_piece[7][7] = { { 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 } };
static char temp_piece[7][7];
static int curx = 0;
static int cury = 0;
static void clear_piece(char piece[7][7]) {
for (int y = 0; y < 7; y++) {
for (int x = 0; x < 7; x++) {
piece[x][y] = 0;
}
}
}
static void copy_piece_from_to(char from[7][7], char to[7][7]) {
for (int y = 0; y < 7; y++) {
for (int x = 0; x < 7; x++) {
to[x][y] = from[x][y];
}
}
}
static void rotate_piece(char piece[7][7]) {
// transpose
for (int y = 0; y < 7; y++) {
for (int x = y + 1; x < 7; x++) {
char tmp = piece[y][x];
piece[y][x] = piece[x][y];
piece[x][y] = tmp;
}
}
// reverse rows
for (int y = 0; y < 7; y++) {
for (int x = 0; x < 3; x++) {
char tmp = piece[y][6 - x];
piece[y][6 - x] = piece[y][x];
piece[y][x] = tmp;
}
}
}
static char get_shape_char(int shape) {
switch (shape) {
case 0: return 'I';
case 1: return 'J';
case 2: return 'L';
case 3: return 'O';
case 4: return 'S';
case 5: return 'T';
case 6: return 'Z';
}
return 'Q';
}
static void set_piece(char piece[7][7], int shape, int rotation) {
clear_piece(piece);
switch (shape) {
case 0:
if (rotation % 2 == 0) {
// xxXx
piece[3][1] = 1;
piece[3][2] = 1;
piece[3][3] = 1;
piece[3][4] = 1;
} else {
// x
// x
// X
// x
piece[1][3] = 1;
piece[2][3] = 1;
piece[3][3] = 1;
piece[4][3] = 1;
}
break;
case 1:
// xXx
// x
piece[3][2] = 1;
piece[3][3] = 1;
piece[3][4] = 1;
piece[4][4] = 1;
for (int i = 0; i < rotation; i++) {
rotate_piece(piece);
}
break;
case 2:
// xXx
// x
piece[3][2] = 1;
piece[3][3] = 1;
piece[3][4] = 1;
piece[4][2] = 1;
for (int i = 0; i < rotation; i++) {
rotate_piece(piece);
}
break;
case 3:
// xX
// xx
piece[3][2] = 1;
piece[3][3] = 1;
piece[4][2] = 1;
piece[4][3] = 1;
break;
case 4:
if (rotation % 2 == 0) {
// xX
// xx
piece[3][2] = 1;
piece[3][3] = 1;
piece[4][3] = 1;
piece[4][4] = 1;
} else {
// x
// xX
// x
piece[2][3] = 1;
piece[3][2] = 1;
piece[3][3] = 1;
piece[4][2] = 1;
}
break;
case 5:
// xXx
// x
piece[3][2] = 1;
piece[3][3] = 1;
piece[3][4] = 1;
piece[4][3] = 1;
for (int i = 0; i < rotation; i++) {
rotate_piece(piece);
}
break;
case 6:
if (rotation % 2 == 0) {
// Xx
// xx
piece[3][3] = 1;
piece[3][4] = 1;
piece[4][2] = 1;
piece[4][3] = 1;
} else {
// x
// Xx
// x
piece[2][3] = 1;
piece[3][3] = 1;
piece[3][4] = 1;
piece[4][4] = 1;
}
break;
}
}
static void send_deletes(int deletes) {
for (int i = 0; i < deletes; i++) {
tetris_send_delete();
}
}
static void send_backspaces(int backspaces) {
for (int i = 0; i < backspaces; i++) {
tetris_send_backspace();
curx--;
}
}
static void send_goto_xy(int x, int y) {
while (curx < x) {
tetris_send_right();
curx++;
}
while (curx > x) {
tetris_send_left();
curx--;
}
while (cury < y) {
tetris_send_down();
cury++;
}
while (cury > y) {
tetris_send_up();
cury--;
}
}
static void draw_row(char c, const char oldrow[7], const char newrow[7], int x, int y) {
char str[2] = { c, 0 };
char row_is_del[7] = { 0 };
int first = -1;
int last = -1;
for (int px = 0; px < 7; px++) {
if (oldrow[px] && !newrow[px]) {
row_is_del[px] = 1;
}
if (newrow[px] || oldrow[px]) {
if (first == -1) first = px;
last = px;
}
}
if (first >= 0) {
if (curx > x + last + 1) {
send_goto_xy(x + last + 1, cury);
}
if (curx < x + first) {
send_goto_xy(x + first, cury);
}
send_goto_xy(curx, y);
send_deletes((x + last + 1) - curx);
send_backspaces(curx - (x + first));
for (int i = first; i <= last; i++) {
if (row_is_del[i]) {
tetris_send_string(".");
} else {
tetris_send_string(str);
}
curx++;
}
}
}
static void move_piece_from_to(char from[7][7], char to[7][7], int xadd, int yadd) {
for (int y = 0; y < 7; y++) {
for (int x = 0; x < 7; x++) {
if (x + xadd >= 0 && x + xadd < 7 && y + yadd >= 0 && y + yadd < 7) {
to[y][x] = from[y + yadd][x + xadd];
} else {
to[y][x] = 0;
}
}
}
}
static void draw_piece(char c, int x, int y, char oldpiece[7][7], char piece[7][7]) {
for (int py = 0; py < 7; py++) {
draw_row(c, oldpiece[py], piece[py], x, y + py);
}
}
static void draw_piece_moved(char c, int x, int y, char piece[7][7], int oldxadd, int oldyadd) {
move_piece_from_to(piece, temp_piece, oldxadd, oldyadd);
draw_piece(c, x, y, temp_piece, piece);
}
static int is_piece_hitting(char board[20][10], char piece[7][7], int x, int y) {
for (int py = 0; py < 7; py++) {
for (int px = 0; px < 7; px++) {
if (piece[py][px] &&
(px + x >= 10 || px + x < 0
|| py + y >= 20 || py + y < 0
|| board[py + y][px + x])) {
return 1;
}
}
}
return 0;
}
static void add_piece_to_board(char piece[7][7], char board[20][10], int x, int y) {
for (int py = 0; py < 7; py++) {
for (int px = 0; px < 7; px++) {
if (piece[py][px]) {
board[py + y][px + x] = piece[py][px];
}
}
}
}
static void draw_board_line(void) {
//send_string("l l");
tetris_send_string("l..........l");
tetris_send_newline();
}
static void init(void) {
for (int i = 0; i < 20; i++) {
draw_board_line();
}
tetris_send_string("doooooooooob");
curx = 12;
cury = 20;
}
static int get_piece_min_y(char piece[7][7]) {
for (int y = 0; y < 7; y++) {
for (int x = 0; x < 7; x++) {
if (piece[y][x])
return y;
}
}
return 0;
}
static int clear_lines(char board[20][10]) {
int cleared_lines = 0;
for (int y = 19; y >= 0; y--) {
char isfull = 1;
for (int x = 0; x < 10; x++) {
if (!board[y][x]) {
isfull = 0;
}
}
if (isfull) {
// delete clear line
send_goto_xy(12, y);
send_backspaces(12); // delete line contents
// delete newline
tetris_send_backspace();
cury--;
curx = 12;
cleared_lines++;
} else {
if (cleared_lines > 0) {
// move cleared lines down on board
for (int x = 0; x < 10; x++) {
board[y + cleared_lines][x] = board[y][x];
}
}
}
}
// clear cleared top lines
for (int y = 0; y < cleared_lines; y++) {
for (int x = 0; x < 10; x++) {
board[y][x] = 0;
}
}
if (cleared_lines > 0) {
send_goto_xy(0, 0);
for (int i = 0; i < cleared_lines; i++) {
draw_board_line();
curx = 0;
cury++;
}
}
return cleared_lines;
}
static uint8_t myrandom(uint8_t seed) {
uint8_t out = seed >> 1;
if (seed & 1) {
out = out ^ 0xB8;
}
return out;
}
static char piece[7][7];
static char board[20][10];
static uint8_t r;
static int score;
static int x;
static int y;
static int shape;
static int rotation;
static int time;
static int next_down;
static int down_delay;
static int first_run;
static int game_over;
void tetris_start(uint8_t seed) {
for (int y = 0; y < 20; y++) {
for (int x = 0; x < 10; x++) {
board[y][x] = 0;
}
}
clear_piece(piece);
init();
game_over = 0;
r = seed;
score = 0;
copy_piece_from_to(empty_piece, piece);
x = 0;
y = 0;
shape = 0;
rotation = 0;
time = 0;
next_down = 0;
down_delay = -1;
first_run = 1;
}
int tetris_tick(int ms_since_previous_tick) {
if (game_over) {
return 0;
}
time += ms_since_previous_tick;
if (first_run || time > next_down) {
if (first_run || is_piece_hitting(board, piece, x, y + 1)) {
first_run = 0;
add_piece_to_board(piece, board, x, y);
score += clear_lines(board);
down_delay = 500 - score * 10;
if (down_delay < 100) {
down_delay = 100;
}
rotation = 0;
shape = r % 7;
r = myrandom(r);
set_piece(piece, shape, rotation);
x = 1;
y = - get_piece_min_y(piece);
draw_piece_moved(get_shape_char(shape), 1 + x, y, piece, 0, 0);
if (is_piece_hitting(board, piece, x, y)) {
game_over = 1;
send_goto_xy(12, 10);
tetris_send_string(" game over");
tetris_send_down();
tetris_send_string(" score ");
char tmp[10];
sprintf(tmp, "%d", score);
tetris_send_string(tmp);
return 0;
}
} else {
y++;
draw_piece_moved(get_shape_char(shape), 1 + x, y, piece, 0, +1);
}
next_down = time + down_delay;
} else {
switch (tetris_get_keypress()) {
case 1: { // up
int oldrotation = rotation;
rotation = (rotation + 1) % 4;
copy_piece_from_to(piece, temp_piece);
set_piece(piece, shape, rotation);
if (is_piece_hitting(board, piece, x, y)) {
rotation = oldrotation;
set_piece(piece, shape, rotation);
} else {
draw_piece(get_shape_char(shape), 1 + x, y, temp_piece, piece);
}
break;
}
case 2: // left
if (!is_piece_hitting(board, piece, x - 1, y)) {
x--;
draw_piece_moved(get_shape_char(shape), 1 + x, y, piece, -1, 0);
}
break;
case 3: {// down
int starty = y;
while (!is_piece_hitting(board, piece, x, y + 1)) {
y++;
}
draw_piece(get_shape_char(shape), x + 1, starty, piece, empty_piece);
draw_piece(get_shape_char(shape), x + 1, y, empty_piece, piece);
next_down = time + down_delay;
break;
}
case 4: // right
if (!is_piece_hitting(board, piece, x + 1, y)) {
x++;
draw_piece_moved(get_shape_char(shape), 1 + x, y, piece, 1, 0);
}
break;
}
}
return 1;
}

View File

@@ -0,0 +1,45 @@
/* Copyright 2017 Dan Amlund Thomsen
*
* 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/>.
*/
#ifndef TETRIS_TEXT_H
#define TETRIS_TEXT_H
//// to implement
void tetris_send_up(void);
void tetris_send_left(void);
void tetris_send_down(void);
void tetris_send_right(void);
void tetris_send_backspace(void);
void tetris_send_delete(void);
void tetris_send_string(const char *s);
void tetris_send_newline(void);
// return = meaning
// 0 = no keys pressed
// 1 = up
// 2 = left
// 3 = down
// 4 = right
int tetris_get_keypress(void);
//// to call
void tetris_start(uint8_t seed);
// returns 0 when game is over
int tetris_tick(int ms_since_previous_tick);
#endif

View File

@@ -1,5 +1,4 @@
TAP_DANCE_ENABLE = yes
LAYER_UNDERGLOW_LIGHTING = yes
SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
COMMAND_ENABLE = no # Commands for debug and configuration
RGBLIGHT_ENABLE = yes

View File

@@ -4,5 +4,3 @@
#define TAPPING_TERM 200
#define LAYER_UNDERGLOW_LIGHTING

View File

@@ -1,3 +1,19 @@
/*
This is the keymap for the keyboard
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
Copyright 2017 Art Ortenburger
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
#include "debug.h"
#include "action_layer.h"
@@ -28,17 +44,18 @@
#define M_SALT M(2)
#define M_HARD M(3)
#define M_MAKE M(4)
#define M_COVECUBE M(5)
#define M_GOODGAME M(5)
#define M_MORESALT M(6)
#define M_DOOMFIST M(7)
//define layer change stuff for underglow indicator
bool skip_leds = false;
//This is both for underglow, and Diablo 3 macros
bool has_layer_changed = false;
static uint8_t current_layer;
static uint16_t key_timer;
//define diablo macro timer variables
static uint16_t diablo_timer[4];
static uint8_t diablo_times[] = {0, 1, 3, 5, 10, 30};
@@ -49,10 +66,6 @@ bool check_dtimer(uint8_t dtimer) {
return (timer_elapsed(diablo_timer[dtimer]) < ( diablo_key_time[dtimer] * 1000 ) ) ? false : true;
};
bool checktime(void){
return (timer_elapsed(key_timer) < 150) ? true : false;
};
enum custom_keycodes {
PLACEHOLDER = SAFE_RANGE, // can always be here
@@ -69,11 +82,7 @@ enum custom_keycodes {
#ifdef TAP_DANCE_ENABLE
enum {
SFT_CAP = 0,
TD_DIABLO_J,
TD_CLN,
TD_EGG,
TD_FLSH,
TD_FLSH = 0,
TD_DIABLO_1,
TD_DIABLO_2,
TD_DIABLO_3,
@@ -82,33 +91,10 @@ enum {
void dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
register_code (KC_RSFT);
register_code (KC_SCLN);
} else {
register_code (KC_SCLN);
}
}
void dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
unregister_code (KC_RSFT);
unregister_code (KC_SCLN);
} else {
unregister_code (KC_SCLN);
}
}
void dance_egg (qk_tap_dance_state_t *state, void *user_data) {
if (state->count >= 10) {
SEND_STRING ("Safety dance!");
reset_tap_dance (state);
}
}
// on each tap, light up one led, from right to left
// on the forth tap, turn them off from right to left
// on the forth tap, turn them off from right to leftmake ergodox-ez-drashna-custom-teensy
void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) {
if (!skip_leds) {
ergodox_board_led_off();
@@ -119,37 +105,38 @@ void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) {
}
switch (state->count) {
case 1:
ergodox_right_led_3_on();
ergodox_right_led_1_on();
break;
case 2:
ergodox_right_led_2_on();
break;
case 3:
ergodox_right_led_1_on();
ergodox_right_led_3_on();
break;
case 4:
ergodox_right_led_3_off();
ergodox_right_led_1_off();
_delay_ms(50);
ergodox_right_led_2_off();
_delay_ms(50);
ergodox_right_led_1_off();
ergodox_right_led_3_off();
}
}
// on the fourth tap, set the keyboard on flash state
// and set the underglow to red, because red == bad
void dance_flsh_finished(qk_tap_dance_state_t *state, void *user_data) {
if (state->count >= 4) {
#ifdef LAYER_UNDERGLOW_LIGHTING
rgblight_enable();
rgblight_mode(1);
rgblight_setrgb(0xff,0x00,0x00);
#endif
reset_keyboard();
reset_tap_dance(state);
}
}
// Cycle through the times for the macro, starting at 0, for disabled.
// Max of six values, so don't exceed
void diablo_tapdance_master (qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) {
if (state->count >= 7) {
diablo_key_time[diablo_key] = diablo_times[0];
@@ -159,6 +146,8 @@ void diablo_tapdance_master (qk_tap_dance_state_t *state, void *user_data, uint8
}
}
// Would rather have one function for all of this, but no idea how to do that...
void diablo_tapdance1 (qk_tap_dance_state_t *state, void *user_data) {
diablo_tapdance_master (state, user_data, 0);
}
@@ -179,28 +168,20 @@ void diablo_tapdance4 (qk_tap_dance_state_t *state, void *user_data) {
// if the flash state didnt happen, then turn off leds, left to right
void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) {
_delay_ms(200);
ergodox_right_led_1_off();
ergodox_right_led_3_off();
_delay_ms(200);
ergodox_right_led_2_off();
_delay_ms(200);
ergodox_right_led_3_off();
ergodox_right_led_1_off();
_delay_ms(500);
skip_leds = false;
}
//Tap Dance Definitions
qk_tap_dance_action_t tap_dance_actions[] = {
//Tap one for Space, and twice for Enter
[SFT_CAP] = ACTION_TAP_DANCE_DOUBLE(KC_LSHIFT, KC_CAPS),
// Special Z
[TD_DIABLO_J] = ACTION_TAP_DANCE_DOUBLE(KC_J, S(KC_J)),
// Once for colin, twice for semi-colin
[TD_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset),
// Tap until you get a surprise
[TD_EGG] = ACTION_TAP_DANCE_FN (dance_egg),
//Once for Blue, Twice for Green, Thrice for Red, and four to flash
[TD_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED (dance_flsh_each, dance_flsh_finished, dance_flsh_reset),
// tap once to disable, and more to enable timed micros
[TD_DIABLO_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1),
[TD_DIABLO_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2),
[TD_DIABLO_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3),
@@ -220,9 +201,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | Bksp | A | S | D | F | G |------| |------| H | J | K | L | ; | ' " |
* |--------+------+------+------+------+------| TG(2)| | TG(2)|------+------+------+------+------+--------|
* | Shift | Z | X | C | V | B | | | | N | M | , < | . > | UP | Shift |
* | Shift | Z | X | C | V | B | | | | N | M | , < | . > | ? / | Shift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | `/SYM| ' " | LGUI | [ { | ] } | | SYMB | ? / | LEFT | DOWN |RIGHT |
* | `/SYM| ' " | LGUI | [ { | ] } | | LEFT | DOWN | UP |RIGHT | SYMB |
* `----------------------------------' `----------------------------------'
* ,--------------. ,--------------.
* |Alt/Ap| Win | | Alt |Ctl/Esc|
@@ -247,7 +228,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TG(DVORAK), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH,
KC_H, KC_J, KC_K, KC_L, KC_SCOLON, GUI_T(KC_QUOTE),
TG(COLEMAK), KC_N, KC_M, KC_COMMA, KC_DOT, CTL_T(KC_SLASH),KC_RSHIFT,
KC_FN1, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT,
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_FN1,
KC_LALT, CTL_T(KC_ESCAPE),
KC_PGUP,
KC_PGDOWN, KC_DELETE, KC_ENTER
@@ -281,16 +262,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_DELT, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(DIABLO),
KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D,
KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(OVERWATCH),
LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LBRACKET,KC_RBRACKET,
LT(SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET,
ALT_T(KC_APP), KC_LGUI,
KC_HOME,
KC_SPC,KC_BSPC,KC_END,
// right hand
KC_TRANSPARENT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
KC_NO, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS,
KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
KC_NO, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS,
KC_H, KC_N, KC_E, KC_I, LT(MOUS, KC_O), KC_QUOTE,
KC_TRANSPARENT,KC_K, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLASH),KC_RSHIFT,
KC_FN1, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT,
KC_TRNS,KC_K,KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLASH),KC_RSHIFT,
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_FN1,
KC_LALT, CTL_T(KC_ESC),
KC_PGUP,
KC_PGDN,KC_TAB, KC_ENT
@@ -324,16 +305,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_DELT, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(DIABLO),
KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I,
KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, TG(OVERWATCH),
LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LBRACKET,KC_RBRACKET,
LT(SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET, KC_RBRACKET,
ALT_T(KC_APP), KC_LGUI,
KC_HOME,
KC_SPC,KC_BSPC,KC_END,
// right hand
KC_TRANSPARENT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
KC_TRANSPARENT, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,
KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
KC_TRNS, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,
KC_D, KC_H, KC_T, KC_N, LT(MOUS, KC_S), KC_MINS,
KC_NO,KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSHIFT,
KC_FN1, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT,
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_FN1,
KC_LALT, CTL_T(KC_ESC),
KC_PGUP,
KC_PGDN,KC_TAB, KC_ENT
@@ -347,43 +328,43 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | VERSION| ! | @ | { | } | | | | | | + | 7 | 8 | 9 | * | F12 |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | MAKE | # | $ | ( | ) | ` |------| |------| - | 4 | 5 | 6 | / | PrtSc |
* |--------+------+------+------+------+------| COVE | | |------+------+------+------+------+--------|
* | RESET | % | ^ | [ | ] | ~ | CUBE | | | NUM | 1 | 2 | 3 | = | PAUSE |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | RESET | % | ^ | [ | ] | ~ | | | | NUM | 1 | 2 | 3 | = | PAUSE |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | LT0 | & | * | : | ; | | 0 | 0 | NUM. | ENT | ENT |
* | LT0 | & | * | : | ; | | | 0 | NUM. | ENT | ENT |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | RGBM | RED | | OFF | SOLID|
* ,------|------|------| |------+------+------.
* | | | GREEN| | | | |
* | RGB | RGB |------| |------| NUM. | NUM0 |
* | RGB | RGB |------| |------| NUM0 | NUME |
* | DARK |BRITE | BLUE | | | | |
* `--------------------' `--------------------'
*/
[SYMB] = KEYMAP(
KC_ESCAPE,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRANSPARENT,
M_VERSION, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRANSPARENT,
KC_ESCAPE,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
M_VERSION, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS,
M_MAKE, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRAVE,
TD(TD_FLSH), KC_PERC, KC_CIRC, KC_LBRACKET,KC_RBRACKET,KC_TILD, M_COVECUBE,
TD(TD_FLSH), KC_PERC, KC_CIRC, KC_LBRACKET,KC_RBRACKET,KC_TILD, KC_TRNS,
KC_NO, KC_AMPR, KC_ASTR, KC_COLN, KC_SCOLON,
RGB_MOD, RGB_0000FF,
RGB_008000,
RGB_VAD, RGB_VAI, RGB_FF0000,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRANSPARENT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_TRANSPARENT, KC_KP_PLUS, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_ASTERISK, KC_F12,
KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_TRNS, KC_KP_PLUS, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_ASTERISK, KC_F12,
KC_KP_MINUS, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_SLASH,KC_PSCREEN,
KC_TRANSPARENT, KC_NUMLOCK, KC_KP_1, KC_KP_2, KC_KP_3, KC_EQUAL, KC_PAUSE,
KC_KP_0, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, KC_KP_ENTER,
KC_TRNS, KC_NUMLOCK, KC_KP_1, KC_KP_2, KC_KP_3, KC_EQUAL, KC_PAUSE,
KC_KP_0, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, KC_TRNS,
RGB_TOG, RGB_SLD,
RGB_HUI,
RGB_HUD, KC_KP_DOT, KC_KP_0
KC_NO,
KC_KP_DOT, KC_KP_0, KC_KP_ENTER
),
/* Keymap 4: Customized Overwatch Layout
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ESC | SALT | SYMM | MORE | DOOM | | | | | F9 | F10 | F11 | F12 | | |
* | ESC | SALT | MORE | GG | SYMM | DOOM | HARD | | | F9 | F10 | F11 | F12 | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | F1 | K | Q | W | E | R | T | | | | | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
@@ -402,10 +383,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `--------------------' `--------------------'
*/
[OVERWATCH] = KEYMAP(
KC_ESCAPE, M_SALT, M_SYMM, M_MORESALT, M_DOOMFIST, KC_NO, KC_NO,
KC_ESCAPE, M_SALT, M_MORESALT, M_GOODGAME, M_SYMM, M_DOOMFIST, M_HARD,
KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T,
KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F,
KC_LCTL, KC_LSHIFT, KC_Z, KC_X, KC_C, KC_M, KC_TRANSPARENT,
KC_LCTL, KC_LSHIFT, KC_Z, KC_X, KC_C, KC_M, KC_TRNS,
KC_G, KC_U, KC_I, KC_Y, KC_T,
KC_O, KC_P,
KC_LGUI,
@@ -444,10 +425,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[DIABLO] = KEYMAP(
KC_ESCAPE, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_NO,
KC_TAB, KC_S, KC_I, KC_F, KC_M, KC_T, KC_TRANSPARENT,
KC_TAB, KC_S, KC_F, KC_I, KC_M, KC_T, KC_TRNS,
KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G,
KC_NUMLOCK, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_4, KC_Z, KC_NO,
KC_LCTL, TD(TD_DIABLO_1), TD(TD_DIABLO_2), TD(TD_DIABLO_3), TD(TD_DIABLO_4),
KC_LCTL, TD(TD_DIABLO_1), TD(TD_DIABLO_2), TD(TD_DIABLO_3), TD(TD_DIABLO_4), KC_Z, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_L, KC_J,
KC_F,
SFT_T(KC_SPACE), ALT_T(KC_Q), KC_DIABLO_CLEAR,
@@ -485,19 +466,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `--------------------' `--------------------'
*/
[MOUS] = KEYMAP(
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_NO, KC_NO, KC_MS_UP, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS,
KC_NO, KC_NO, KC_MS_UP, KC_NO, KC_NO, KC_NO, KC_TRNS,
KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT,KC_NO, KC_NO,
KC_NO, KC_MS_ACCEL0,KC_MS_ACCEL1,KC_MS_ACCEL2,KC_NO, KC_NO, KC_TRANSPARENT,
KC_NO, KC_MS_ACCEL0,KC_MS_ACCEL1,KC_MS_ACCEL2,KC_NO, KC_NO, KC_TRNS,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO,KC_NO,
KC_MS_WH_UP,
KC_MS_BTN1,KC_MS_BTN2,KC_MS_WH_DOWN,
KC_TRANSPARENT,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,
KC_TRANSPARENT,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,
KC_TRNS,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,
KC_TRNS,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,
KC_NO,KC_NO,KC_MS_ACCEL0,KC_MS_ACCEL1,KC_MS_ACCEL2,KC_NO,KC_NO,
KC_TRANSPARENT,KC_MEDIA_PLAY_PAUSE,KC_MEDIA_STOP,KC_AUDIO_MUTE,KC_AUDIO_VOL_DOWN,KC_AUDIO_VOL_UP,KC_NO,
KC_TRNS,KC_MEDIA_PLAY_PAUSE,KC_MEDIA_STOP,KC_AUDIO_MUTE,KC_AUDIO_VOL_DOWN,KC_AUDIO_VOL_UP,KC_NO,
KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,
KC_NO,KC_NO,
KC_NO,
@@ -509,10 +490,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB),
// FN1 - Momentary Layer 1 (Symbols)
[2] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_UP),
[3] = ACTION_MODS_TAP_KEY(MOD_RGUI, KC_LEFT),
[4] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_DOWN),
[5] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_RIGHT),
};
void action_function(keyrecord_t *event, uint8_t id, uint8_t opt)
@@ -547,13 +524,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case 4:
if (record->event.pressed) {
// make ergodox-ez-drashna-custom-teensy
return MACRO( I(5), T(M), T(A), T(K), T(E), T(SPACE), T(E), T(R), T(G), T(O), T(D), T(O), T(X), T(MINUS), T(E), T(Z), T(MINUS), T(D), T(R), T(A), T(S), T(H), T(N), T(A), T(MINUS), T(C), T(U), T(S), T(T), T(O), T(M), T(MINUS), T(T), T(E), T(E), T(N), T(S), T(Y), T(ENTER), END );
return MACRO(I(5), T(M), T(A), T(K), T(E), T(SPACE), T(E), T(R), T(G), T(O), T(D), T(O), T(X), D(LSFT), T(MINUS), U(LSFT), T(E), T(Z), T(MINUS), T(D), T(R), T(A), T(S), T(H), T(N), T(A), T(MINUS), T(C), T(U), T(S), T(T), T(O), T(M), T(MINUS), T(T), T(E), T(E), T(N), T(S), T(Y), T(ENTER), END);
}
case 5:
if (record->event.pressed) {
//super secret hash
SEND_STRING("supersecrethash");
return MACRO_NONE;
//gg
return MACRO(I(50), T(ENTER), I(5), T(G), T(G), T(ENTER), END);
}
case 6:
if (record->event.pressed) {
@@ -562,40 +538,15 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
}
break;
case 7:
if (record->event.pressed) {
// DoomFisted
// Hey, look at me. I'm Doomfist, and I'm overpowered!
// All I do is spam punches all day! I'm DPS, tank and
// defense, rolled into one! All I need is team healing to be complete!
return MACRO( I(50), T(ENTER), I(5), D(LSFT), T(H), U(LSFT), T(E), T(Y), T(COMMA), T(SPACE), T(L), T(O), T(O), T(K), T(SPACE), T(A), T(T), T(SPACE), T(M), T(E), T(DOT), T(SPACE), T(SPACE), D(LSFT), T(I), U(LSFT), T(QUOTE), T(M), T(SPACE), D(LSFT), T(D), U(LSFT), T(O), T(O), T(M), T(F), T(I), T(S), T(T), T(COMMA), T(SPACE), T(A), T(N), T(D), T(SPACE), D(LSFT), T(I), U(LSFT), T(QUOTE), T(M), T(SPACE), T(O), T(V), T(E), T(R), T(P), T(O), T(W), T(E), T(R), T(E), T(D), D(LSFT), T(1), U(LSFT), T(SPACE), T(SPACE), D(LSFT), T(A), U(LSFT), T(L), T(L), T(SPACE), D(LSFT), T(I), U(LSFT), T(SPACE), T(D), T(O), T(SPACE), T(I), T(S), T(SPACE), T(S), T(P), T(A), T(M), T(SPACE), T(P), T(U), T(N), T(C), T(H), T(E), T(S), T(SPACE), T(A), T(L), T(L), T(SPACE), T(D), T(A), T(Y), D(LSFT), T(1), U(LSFT), T(SPACE), T(SPACE), T(SPACE), D(LSFT), T(I), U(LSFT), T(QUOTE), T(M), T(SPACE), D(LSFT), T(D), U(LSFT), D(LSFT), T(P), U(LSFT), D(LSFT), T(S), U(LSFT), T(COMMA), T(SPACE), T(T), T(A), T(N), T(K), T(SPACE), T(A), T(N), T(D), T(SPACE), T(D), T(E), T(F), T(E), T(N), T(S), T(E), T(COMMA), T(SPACE), T(R), T(O), T(L), T(L), T(E), T(D), T(SPACE), T(I), T(N), T(T), T(O), T(SPACE), T(O), T(N), T(E), D(LSFT), T(1), U(LSFT), T(SPACE), D(LSFT), T(A), U(LSFT), T(L), T(L), T(SPACE), D(LSFT), T(I), U(LSFT), T(SPACE), T(N), T(E), T(E), T(D), T(SPACE), T(I), T(S), T(SPACE), T(T), T(E), T(A), T(M), T(SPACE), T(H), T(E), T(A), T(L), T(I), T(N), T(G), T(SPACE), T(T), T(O), T(SPACE), T(B), T(E), T(SPACE), T(C), T(O), T(M), T(P), T(L), T(E), T(T), T(E), D(LSFT), T(1), U(LSFT), T(ENTER), END );
}
case 8: //MAC1 - Hold for rshift and } on tap
if (record->event.pressed) {
key_timer = timer_read();
return MACRO(D(LSFT), END );
} else {
return checktime() ? MACRO(U(LSFT),D(RALT),T(7),U(RALT),END): MACRO(U(LSFT),END);
}; break;
case 9: //MAC1 - Hold for rshift and } on tap
if (record->event.pressed) {
key_timer = timer_read();
return MACRO(D(RSFT), END );
} else {
return checktime() ? MACRO(U(RSFT),D(RALT),T(0),U(RALT),END): MACRO(U(RSFT),END);
}; break;
case 10: //MAC2 - Hold for lctrl and [ on tap
if (record->event.pressed) {
key_timer = timer_read();
return MACRO(D(LCTL), END );
} else {return checktime() ? MACRO(U(LCTL),D(RALT),T(8),U(RALT),END):MACRO(U(LCTL),END);
}; break;
case 11: //MAC3 - Hold for rctrl and ] on tap
if (record->event.pressed) {
key_timer = timer_read();
return MACRO(D(RCTL), END );
} else {
return checktime() ? MACRO(U(RCTL),D(RALT),T(9),U(RALT),END):MACRO(U(RCTL),END);
}; break;
if (record->event.pressed) {
// DoomFisted
// Hey, look at me. I'm Doomfist, and I'm overpowered!
// All I do is spam punches all day! I'm DPS, tank and
// defense, rolled into one! All I need is team healing to be complete!
return MACRO( I(50), T(ENTER), I(5), D(LSFT), T(H), U(LSFT), T(E), T(Y), T(COMMA), T(SPACE), T(L), T(O), T(O), T(K), T(SPACE), T(A), T(T), T(SPACE), T(M), T(E), T(DOT), T(SPACE), T(SPACE), D(LSFT), T(I), U(LSFT), T(QUOTE), T(M), T(SPACE), D(LSFT), T(D), U(LSFT), T(O), T(O), T(M), T(F), T(I), T(S), T(T), T(COMMA), T(SPACE), T(A), T(N), T(D), T(SPACE), D(LSFT), T(I), U(LSFT), T(QUOTE), T(M), T(SPACE), T(O), T(V), T(E), T(R), T(P), T(O), T(W), T(E), T(R), T(E), T(D), D(LSFT), T(1), U(LSFT), T(SPACE), T(SPACE), D(LSFT), T(A), U(LSFT), T(L), T(L), T(SPACE), D(LSFT), T(I), U(LSFT), T(SPACE), T(D), T(O), T(SPACE), T(I), T(S), T(SPACE), T(S), T(P), T(A), T(M), T(SPACE), T(P), T(U), T(N), T(C), T(H), T(E), T(S), T(SPACE), T(A), T(L), T(L), T(SPACE), T(D), T(A), T(Y), D(LSFT), T(1), U(LSFT), T(SPACE), T(SPACE), T(SPACE), D(LSFT), T(I), U(LSFT), T(QUOTE), T(M), T(SPACE), D(LSFT), T(D), U(LSFT), D(LSFT), T(P), U(LSFT), D(LSFT), T(S), U(LSFT), T(COMMA), T(SPACE), T(T), T(A), T(N), T(K), T(SPACE), T(A), T(N), T(D), T(SPACE), T(D), T(E), T(F), T(E), T(N), T(S), T(E), T(COMMA), T(SPACE), T(R), T(O), T(L), T(L), T(E), T(D), T(SPACE), T(I), T(N), T(T), T(O), T(SPACE), T(O), T(N), T(E), D(LSFT), T(1), U(LSFT), T(SPACE), D(LSFT), T(A), U(LSFT), T(L), T(L), T(SPACE), D(LSFT), T(I), U(LSFT), T(SPACE), T(N), T(E), T(E), T(D), T(SPACE), T(I), T(S), T(SPACE), T(T), T(E), T(A), T(M), T(SPACE), T(H), T(E), T(A), T(L), T(I), T(N), T(G), T(SPACE), T(T), T(O), T(SPACE), T(B), T(E), T(SPACE), T(C), T(O), T(M), T(P), T(L), T(E), T(T), T(E), D(LSFT), T(1), U(LSFT), T(ENTER), END );
}
break;
}
return MACRO_NONE;
};
@@ -677,7 +628,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
break;
case KC_DIABLO_CLEAR:
case KC_DIABLO_CLEAR: // reset all Diable timers, disabling them
if (record->event.pressed) {
uint8_t dtime;
@@ -692,6 +643,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
// Sends the key press to system, but only if on the Diablo layer
void send_diablo_keystroke (uint8_t diablo_key) {
if (current_layer == DIABLO) {
switch (diablo_key) {
@@ -711,6 +664,8 @@ void send_diablo_keystroke (uint8_t diablo_key) {
}
}
// Checks each of the 4 timers/keys to see if enough time has elapsed
// Runs the "send string" command if enough time has passed, and resets the timer.
void run_diablo_macro_check(void) {
uint8_t dtime;
@@ -724,32 +679,7 @@ void run_diablo_macro_check(void) {
}
void matrix_init_user(void) { // Runs boot tasks for keyboard
wait_ms(500);
ergodox_board_led_on();
wait_ms(200);
ergodox_right_led_1_on();
wait_ms(200);
ergodox_right_led_2_on();
wait_ms(200);
ergodox_right_led_3_on();
wait_ms(200);
ergodox_board_led_off();
wait_ms(200);
ergodox_right_led_1_off();
wait_ms(200);
ergodox_right_led_2_off();
wait_ms(200);
ergodox_right_led_3_off();
#ifdef LAYER_UNDERGLOW_LIGHTING
rgblight_enable();
rgblight_sethsv(195,255,255);
#endif
has_layer_changed = false;
has_layer_changed = true;
};
@@ -764,6 +694,9 @@ void matrix_scan_user(void) { // runs frequently to update info
ergodox_right_led_2_off();
ergodox_right_led_3_off();
// Since we're not using the LEDs here for layer indication anymore,
// then lets use them for modifier indicators. Shame we don't have 4...
// Also, no "else", since we want to know each, independantly.
if ( modifiders & MODS_SHIFT_MASK) {
ergodox_right_led_1_on();
}
@@ -775,93 +708,61 @@ void matrix_scan_user(void) { // runs frequently to update info
}
}
// Check layer, and apply color if its changed since last check
switch (layer) {
case SYMB:
#ifdef LAYER_UNDERGLOW_LIGHTING
if (has_layer_changed) {
rgblight_sethsv (240,255,255);
}
#else
ergodox_right_led_3_on();
#endif
break;
case OVERWATCH:
#ifdef LAYER_UNDERGLOW_LIGHTING
if (has_layer_changed) {
rgblight_sethsv (30,255,255);
}
#else
ergodox_right_led_2_on();
#endif
break;
case DIABLO:
#ifdef LAYER_UNDERGLOW_LIGHTING
if (has_layer_changed) {
rgblight_sethsv (0,255,255);
}
#else
ergodox_right_led_1_on();
#endif
break;
case MOUS:
#ifdef LAYER_UNDERGLOW_LIGHTING
if (has_layer_changed) {
rgblight_sethsv (60,255,255);
}
#else
ergodox_right_led_3_on();
ergodox_right_led_2_on();
#endif
break;
case COLEMAK:
#ifdef LAYER_UNDERGLOW_LIGHTING
if (has_layer_changed) {
rgblight_sethsv (300,255,255);
}
#else
ergodox_right_led_1_on();
ergodox_right_led_3_on();
#endif
break;
case DVORAK:
#ifdef LAYER_UNDERGLOW_LIGHTING
if (has_layer_changed) {
rgblight_sethsv (120,255,255);
}
#else
ergodox_right_led_2_on();
ergodox_right_led_1_on();
#endif
break;
case 7:
#ifdef LAYER_UNDERGLOW_LIGHTING
if (has_layer_changed) {
rgblight_sethsv (255,255,255);
}
#else
ergodox_right_led_1_on();
ergodox_right_led_2_on();
ergodox_right_led_3_on();
#endif
break;
case OVERWATCH:
if (has_layer_changed) {
rgblight_sethsv (30,255,255);
}
break;
case DIABLO:
if (has_layer_changed) {
rgblight_sethsv (0,255,255);
}
break;
case MOUS:
if (has_layer_changed) {
rgblight_sethsv (60,255,255);
}
break;
case COLEMAK:
if (has_layer_changed) {
rgblight_sethsv (300,255,255);
}
break;
case DVORAK:
if (has_layer_changed) {
rgblight_sethsv (120,255,255);
}
break;
case 7:
if (has_layer_changed) {
rgblight_sethsv (255,255,255);
}
break;
default:
// Do not add anything here, as this will be ran EVERY check, and can cause a significant slowdown
#ifdef LAYER_UNDERGLOW_LIGHTING
if (has_layer_changed) {
rgblight_sethsv (195,255,255);
}
#endif
break;
}
// Update layer status at the end, so this sets the default color
// rather than relying on the init, which was unreliably...
// Probably due to a timing issue, but this requires no additional code
if (current_layer == layer) {
has_layer_changed = false;
} else {
has_layer_changed = true;
current_layer = layer;
}
// Run Diablo 3 macro checking code.
run_diablo_macro_check();
};

View File

@@ -1,2 +1,2 @@
:0B0000000000000000000000000001F4
:0F000000000000000000000000000000000001F0
:00000001FF

View File

@@ -1,2 +1,2 @@
:0B0000000000000000000000000000F5
:0F000000000000000000000000000000000000F1
:00000001FF

View File

@@ -2,11 +2,7 @@
#define SPLIT_KEYBOARD_UTIL_H
#include <stdbool.h>
#ifdef EE_HANDS
#define EECONFIG_BOOTMAGIC_END (uint8_t *)10
#define EECONFIG_HANDEDNESS EECONFIG_BOOTMAGIC_END
#endif
#include "eeconfig.h"
#define SLAVE_I2C_ADDRESS 0x32

View File

@@ -0,0 +1,17 @@
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = yes # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
API_SYSEX_ENABLE = no
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View File

@@ -1,74 +1,24 @@
#ifndef CONFIG_H
#define CONFIG_H
#include "config_common.h"
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
/* USB Device descriptor parameter */
#include "../../config.h"
#define VENDOR_ID 0xFEEB
#define PRODUCT_ID 0x6060
#define DEVICE_VER 0x0001
#define MANUFACTURER MJT
#define PRODUCT Mitosis
#define DESCRIPTION q.m.k. keyboard firmware for Mitosis
#ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PLANCK_SOUND)
// #define STARTUP_SONG SONG(NO_SOUND)
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 10
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
SONG(COLEMAK_SOUND), \
SONG(DVORAK_SOUND) \
}
#endif
#define AUDIO_VOICES
#define C6_AUDIO
// fix iPhone power adapter issue
#define USB_MAX_POWER_CONSUMPTION 50
// #define CATERINA_BOOTLOADER
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
//#define BACKLIGHT_LEVELS 3
#define ONESHOT_TIMEOUT 500
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
#define PREVENT_STUCK_MODIFIERS
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
//UART settings for communication with the RF microcontroller
#define SERIAL_UART_BAUD 1000000
#define SERIAL_UART_DATA UDR1
#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1))
#define SERIAL_UART_INIT() do { \
/* baud rate */ \
UBRR1L = SERIAL_UART_UBRR; \
/* baud rate */ \
UBRR1H = SERIAL_UART_UBRR >> 8; \
/* enable TX and RX */ \
UCSR1B = _BV(TXEN1) | _BV(RXEN1); \
/* 8-bit data */ \
UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
} while(0)
#endif

View File

@@ -28,6 +28,7 @@ enum mitosis_keycodes
MACSLEEP,
FNMAC,
FNPC,
AUDIOTEST,
DYNAMIC_MACRO_RANGE,
};
@@ -236,7 +237,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
persistent_function_layer_set(_FUNCTIONPC);
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_fnpc, false, 0);
PLAY_SONG(tone_fnpc);
#endif
}
return false;
@@ -245,9 +246,22 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
persistent_function_layer_set(_FUNCTIONMAC);
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_fnmac, false, 0);
PLAY_SONG(tone_fnmac);
#endif
}
return false;
break;
case AUDIOTEST:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(music_scale);
register_code(KC_M);
unregister_code(KC_M);
#endif
register_code(KC_A);
} else {
unregister_code(KC_A);
}
return false;
break;
//If any other key was pressed during the layer mod hold period,
@@ -279,12 +293,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
void startup_user()
{
_delay_ms(20); // gets rid of tick
PLAY_NOTE_ARRAY(tone_startup, false, 0);
PLAY_SONG(tone_startup);
}
void shutdown_user()
{
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
PLAY_SONG(tone_goodbye);
_delay_ms(150);
stop_all_notes();
}
@@ -296,7 +310,7 @@ void music_on_user(void)
void music_scale_user(void)
{
PLAY_NOTE_ARRAY(music_scale, false, 0);
PLAY_SONG(music_scale);
}
#endif

View File

@@ -68,8 +68,8 @@ Gaming mode (Raise)
|------+------+------+------+------+------+------+------+------+------+------+------|
| CTRL | | | | F | | | | | | | |
|------+------+------+------+------+------+------+------+------+------+------+------|
| Shift| Z | | | | | | | | | | |
| Shift| Z | | | | | | | | | | GUI |
|------+------+------+------+------+------+------+------+------+------+------+------|
| Enter| | Lock | | Alt | Spc | Lower| Left | Up | Down | Right|QWERTY|
| Enter| | Lock | Bksp | Alt | Spc | Lower| Left | Up | Down | Right|QWERTY|
`-----------------------------------------------------------------------------------'
```

View File

@@ -35,11 +35,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = KEYMAP( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, \
KC_ESC, KC_A, KC_S, KC_D, LT(_VIM, KC_F), KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), OSM(MOD_RSFT), \
KC_LCTL, KC_LALT, KC_F4, KC_LGUI, OSL(_LOWER), KC_BSPC, KC_SPC, KC_ENT, KC_LOCK, KC_EQL, TG(_GAME), KC_DEL \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, \
KC_ESC, KC_A, KC_S, KC_D, LT(_VIM, KC_F), KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), OSM(MOD_RSFT), \
KC_LCTL, KC_LALT, KC_F4, KC_LGUI, OSL(_LOWER), KC_BSPC, KC_SPC, KC_ENT, KC_LOCK, KC_EQL, TG(_GAME), KC_DEL \
),
/* Lower
@@ -56,11 +56,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = KEYMAP( \
KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \
_______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, KC_7, KC_8, KC_9, KC_ASTR, KC_RPRN, KC_F12, \
_______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, KC_4, KC_5, KC_6, KC_PLUS, KC_RCBR, KC_PIPE, \
M(PSCREEN_APP), KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_1, KC_2, KC_3, KC_BSLS, KC_VOLD, KC_VOLU, \
KC_PSCR, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, KC_MPRV, KC_MNXT, KC_MPLY \
KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \
_______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, KC_7, KC_8, KC_9, KC_ASTR, KC_RPRN, KC_F12, \
_______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, KC_4, KC_5, KC_6, KC_PLUS, KC_RCBR, KC_PIPE, \
M(PSCREEN_APP), KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_1, KC_2, KC_3, KC_BSLS, KC_VOLD, KC_VOLU, \
KC_PSCR, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, KC_MPRV, KC_MNXT, KC_MPLY \
),
/* Vim Movement (Hold down F)
@@ -77,11 +77,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------'
*/
[_VIM] = KEYMAP( \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, M(DLEFT), M(DRIGHT), KC_LCTL, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______ \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, M(DLEFT), M(DRIGHT), KC_LCTL, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______ \
),
/* Gaming mode (Raise)
@@ -93,24 +93,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | CTRL | | | | F | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Shift| Z | | | | | | | | | | |
* | Shift| Z | | | | | | | | | | GUI |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Enter| | Lock | | Alt | Spc | Lower| Left | Up | Down | Right|QWERTY|
* | Enter| | Lock | Bksp | Alt | Spc | Lower| Left | Up | Down | Right|QWERTY|
* `-----------------------------------------------------------------------------------'
*/
[_GAME] = KEYMAP( \
KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
KC_LCTL, _______, _______, _______, KC_F, _______, _______, _______, _______, _______, _______, _______, \
KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
KC_ENT, _______, KC_LOCK, _______, KC_LALT, KC_SPC, OSL(_LOWER), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(_QWERTY) \
KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
KC_LCTL, _______, _______, _______, KC_F, _______, _______, _______, _______, _______, _______, _______, \
KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \
KC_ENT, _______, KC_LOCK, KC_BSPC, KC_LALT, KC_SPC, OSL(_LOWER), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(_QWERTY) \
)
};
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {

View File

@@ -0,0 +1,79 @@
#include "satan.h"
#define _BASE 0
#define _FNO 1
#define _FNT 2
#define ________ KC_TRNS
#define XXXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
Base layer
-------------------------------------------------------------------------------------------
| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | Del |
-------------------------------------------------------------------------------------------
| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp |
-------------------------------------------------------------------------------------------
| Fn1 | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
-------------------------------------------------------------------------------------------
| Shift | Z | X | C | V | B | N | M | , | . | / | Up | Fn2 |
-------------------------------------------------------------------------------------------
| Ctrl | Win | Alt | Space | AltGr | Left | Down | Right |
-------------------------------------------------------------------------------------------
*/
[_BASE] = KEYMAP_HHKB(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \
MO(_FNO), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, MO(_FNT), \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT),
/*
Fn1 layer
-------------------------------------------------------------------------------------------
| Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Prsc| Ins |
-------------------------------------------------------------------------------------------
| | | | | | | | | | | | | | |
-------------------------------------------------------------------------------------------
| NONE | | | | | | | | | | | | |
-------------------------------------------------------------------------------------------
| | | | | | | | | | | | PgUp | |
-------------------------------------------------------------------------------------------
| | | | | | Home | PgDn | End |
-------------------------------------------------------------------------------------------
*/
[_FNO] = KEYMAP_HHKB(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, \
________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, \
________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, \
________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, KC_PGUP, ________, \
________, ________, ________, ________, ________, KC_HOME, KC_PGDN, KC_END),
/*
Fn2 layer
TODO: macro buttons
-------------------------------------------------------------------------------------------
| | | | | | | | | | | | | | | |
-------------------------------------------------------------------------------------------
| | | | | | | | | | Prev| Play| Next| | |
-------------------------------------------------------------------------------------------
| CapsLk | | | | | | | | | Vol-| Vol+| Mute| |
-------------------------------------------------------------------------------------------
| | | | | | | | | | Stop| | | NONE|
-------------------------------------------------------------------------------------------
| Reset | Menu | | | M1 | M2 | M3 | M4 |
-------------------------------------------------------------------------------------------
*/
[_FNT] = KEYMAP_HHKB(
________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, ________, \
________, ________, ________, ________, ________, ________, ________, ________, ________, KC_MPRV, KC_MPLY, KC_MNXT, ________, ________, \
KC_CAPS, ________, ________, ________, ________, ________, ________, ________, ________, KC_VOLD, KC_VOLU, KC_MUTE, ________, \
________, ________, ________, ________, ________, ________, ________, ________, ________, KC_MSTP, ________, ________, ________, \
RESET, KC_MENU, ________, ________, ________, ________, ________, ________),
};

View File

@@ -18,7 +18,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------|
* | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | ~L1 | Alt |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
* | ~L1 | Alt |AltShf| Left | Right| | Up | Down |AltShf| Alt | ~L1 |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | App | Home | | PgUp |Ctrl/Esc|
@@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_EQL, 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, MO(SYMB),
KC_UP, KC_DOWN,RALT(KC_RSFT), KC_RALT, MO(SYMB),
KC_PGUP, CTL_T(KC_ESC),
KC_PGDN,
@@ -102,9 +102,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | | | | | | | | | | | Lclk | Rclk | | F12 |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | |------| |------|MsLeft|MsDown| MsUp |MsRght| | Play |
* | | | | | | |------| |------|MsLeft|MsDown| MsUp |MsRght| | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | Prev | Next | | |
* | | | | | | | | | | | Prev | Play | Next | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | |VolUp |VolDn | Mute | | |
* `----------------------------------' `----------------------------------'
@@ -129,8 +129,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// right hand
KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_F12,
KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_MPLY,
KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS,
KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,

View File

@@ -4,7 +4,7 @@
Essentially, I wanted to switch to a layout that was less jarring than the default ErgoDox EZ layout, and did not require finger gymnastics to perform common OS X shortcuts (most of which involve the CMD (LGui) key).
## How is it different from the default ErgoDox EZ layout?
## How is it different from the default ErgoDox EZ default_osx layout?
This layout more closely resembles that of the Mac keyboard, and has some other goodness baked in. Here is a rundown of what that means:
@@ -18,15 +18,16 @@ This layout more closely resembles that of the Mac keyboard, and has some other
### Other changes
- **The button to the left of "A" is Ctrl/Esc instead of Backspace.** This is actually how I have the keyboard on my Macbook set up to be, since it's loads more convenient than a CAPS LOCK key. This is the Ctrl key I find myself using most.
- **Mouse uses Vim-style navigation**. To activate "Media mode," hold the 'a' key. This allows you to move the mouse around with hjkl just like in Vim. Additionally, right and left click are the conveniently placed 'i' and 'o' keys.
- **The button to the left of "A" is Ctrl/Esc instead of Backspace.** This is actually how I have the keyboard on my Macbook set up to be, since it's loads more convenient than a CAPS LOCK key. This is the Ctrl key I find myself using most.
- **Mouse uses Vim-style navigation**. This allows you to move the mouse around with hjkl just like in Vim. Additionally, right and left click are the conveniently placed 'i' and 'o' keys.
- **The key to the right of "5" and the key to left of "6" are "[" and "]", respectively, instead of Left and Right.** There is a more convenient set of Left and Right already present. Truth be told, I don't really use these keys, as they are a stretch to reach.
- **The Toggle L1 keys have been replaced by the otherwise displaced "-" and "=".** They are laid out, left-to-right, in the same order as on the Mac keyboard. Honestly, they are not terribly conveniently placed, and their placement might change in a later version. I found that I did not toggle L1 frequently at all, and found using the momentary keys to access L1 to fit my workflow better.
- **The "~"/L1 key in the bottom-left is now just momentary L1.** The "~" key was moved to the top-left as mentioned before, and I like to keep my multi-use keys to a minimum due to the latency for them to switch from "press" to "hold."
- **The Home and End buttons have been shifted up on the left thumb, and Shift inserted below them.** This makes doing Shift-5 and other such combinations less painful.
- **The Page Up and Page Down buttons have been shifted up on the right thumb.** I don't use either of these keys often, and wanted to free up some real estate.
- **The bottommost-inner keys on the left and right thumb are momentary L2 and momentary L1, respectively**. I have found that both modes are useful, and this seemed like a reasonably accessible place to put these.
- **The Toggle L1 keys in the center of the keyboard have been replaced by the otherwise displaced "-" and "=".** They are laid out, left-to-right, in the same order as on the Mac keyboard. Honestly, they are not terribly conveniently placed, and their placement might change in a later version. I found that the ~L1 would be better situated elsewhere.
- **The "~" key in the extreme bottom-left is now just momentary L1.** The "~" key was moved to the top-left as mentioned before, and I like to keep my multi-use keys to a minimum due to the latency for them to switch from "press" to "hold."
- **The Home and End buttons have been shifted up on the left thumb, and ~L2 inserted below them.** Nearly all of my media layer changes are on the right side, so the ~L2 key is on the left side.
- **The Page Up and Page Down buttons have been shifted up on the right thumb, and ~L1 inserted below them.** I don't use either of the "Page" keys often, and use this ~L1 more than any other.
- **Traditional numpad layout.** The base of most numpads is a double-wide "0" key to the left of a "." key. This is reflected in my layout by having two "0" keys to the left of a "." key.
- **The function keys (F1-F12) have been moved to L2.** They were in the way in L1.
- **⏯ lives on ',' in the media layer, between ⏪ on 'm' and ⏩ on '.'.** This is the way they are laid out on the mac keyboard, and makes the most sense to me.
- **The keys on the bottom-right that were formerly "[" and "]" are now Alt-Shift and Alt, respectively.** This enables me to do those `C-M-<key>` bindings in emacs. I use L1 for "[" and "]".
**I'm always open to feedback and/or suggestions!**

View File

@@ -49,6 +49,9 @@ void unicode_input_start (void) {
case UC_OSX:
register_code(KC_LALT);
break;
case UC_OSX_RALT:
register_code(KC_RALT);
break;
case UC_LNX:
register_code(KC_LCTL);
register_code(KC_LSFT);
@@ -78,6 +81,9 @@ void unicode_input_finish (void) {
case UC_WIN:
unregister_code(KC_LALT);
break;
case UC_OSX_RALT:
unregister_code(KC_RALT);
break;
case UC_LNX:
register_code(KC_SPC);
unregister_code(KC_SPC);

View File

@@ -37,6 +37,7 @@ void register_hex(uint16_t hex);
#define UC_WIN 2 // Windows 'HexNumpad'
#define UC_BSD 3 // BSD (not implemented)
#define UC_WINC 4 // WinCompose https://github.com/samhocevar/wincompose
#define UC_OSX_RALT 5 // Mac OS X using Right Alt key for Unicode Compose
#define UC_BSPC UC(0x0008)

View File

@@ -50,7 +50,7 @@ bool process_unicode_map(uint16_t keycode, keyrecord_t *record) {
const uint32_t* map = unicode_map;
uint16_t index = keycode - QK_UNICODE_MAP;
uint32_t code = pgm_read_dword(&map[index]);
if (code > 0xFFFF && code <= 0x10ffff && input_mode == UC_OSX) {
if (code > 0xFFFF && code <= 0x10ffff && (input_mode == UC_OSX || input_mode == UC_OSX_RALT)) {
// Convert to UTF-16 surrogate pair
code -= 0x10000;
uint32_t lo = code & 0x3ff;
@@ -59,7 +59,7 @@ bool process_unicode_map(uint16_t keycode, keyrecord_t *record) {
register_hex32(hi + 0xd800);
register_hex32(lo + 0xdc00);
unicode_input_finish();
} else if ((code > 0x10ffff && input_mode == UC_OSX) || (code > 0xFFFFF && input_mode == UC_LNX)) {
} else if ((code > 0x10ffff && (input_mode == UC_OSX || input_mode == UC_OSX_RALT)) || (code > 0xFFFFF && input_mode == UC_LNX)) {
// when character is out of range supported by the OS
unicode_map_input_error();
} else {

View File

@@ -163,9 +163,12 @@ avrdude: $(BUILD_DIR)/$(TARGET).hex
fi
# Convert hex to bin.
flashbin: $(BUILD_DIR)/$(TARGET).hex
bin: $(BUILD_DIR)/$(TARGET).hex
$(OBJCOPY) -Iihex -Obinary $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
$(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin;
# copy bin to FLASH.bin
flashbin: bin
$(COPY) $(BUILD_DIR)/$(TARGET).bin FLASH.bin;
# Generate avr-gdb config/init file which does the following:

View File

@@ -155,3 +155,6 @@ DFU_UTIL ?= dfu-util
dfu-util: $(BUILD_DIR)/$(TARGET).bin sizeafter
$(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin
bin: $(BUILD_DIR)/$(TARGET).bin sizeafter
$(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin;