added ALU84 keyboard and TurboMech user space (#2206)

* Added ALU84

Added ALU84 from mechkeys.ca.  TurboMech keymap is MacOS oriented, need to still update the defualt keymap.

* added alu84 and TurboMech userspace

* updated keymap, config.h and rules.mk for alu84
daktil_manuform
TurboMech 2017-12-31 22:39:34 -05:00 committed by Jack Humbert
parent 9cb80d68e2
commit e9f44ee96d
13 changed files with 1257 additions and 0 deletions

View File

@ -0,0 +1,46 @@
/* Copyright 2017 @TurboMech /u/TurboMech <discord> @A9entOran9e#6134
*
* 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 "alu84.h"
#include "rgblight.h"
#include "action_layer.h"
#include "quantum.h"
#include "action.h"
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}

View File

@ -0,0 +1,41 @@
/* Copyright 2017 @TurboMech /u/TurboMech <discord> @A9entOran9e#6134
*
* 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 ALU84_H
#define ALU84_H
#include "quantum.h"
#define KEYMAP( \
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \
K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, \
K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K315, \
K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K413, K414, K415, \
K500, K501, K503, K506, K510, K511, K512, K513, K514, K515 \
) { \
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114, K115 }, \
{ K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \
{ K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, K315 }, \
{ K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, K414, K415 }, \
{ K500, K501, KC_NO, K503, KC_NO, KC_NO, K506, KC_NO, KC_NO, KC_NO, K510, K511, K512, K513, K514, K515 } \
}
#endif

View File

@ -0,0 +1,76 @@
/* Copyright 2017 @TurboMech /u/TurboMech <discord> @A9entOran9e#6134
*
* 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 ALU84_CONFIG_H
#define ALU84_CONFIG_H
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6060
#define DEVICE_VER 0x0001
#define MANUFACTURER mechkeys.ca
#define PRODUCT ALU84
#define DESCRIPTION A 75% keyboard
/* key matrix size */
#define MATRIX_ROWS 6
#define MATRIX_COLS 16
/* key matrix pins */
#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5, B7 }
#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, F5, D4, B1, B0, B5, B4, D7, D6, B3, F4, F6 }
#define UNUSED_PINS
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* number of backlight levels */
#define BACKLIGHT_PIN B6
#ifdef BACKLIGHT_PIN
#define BACKLIGHT_LEVELS 3
#endif
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS
#define RGB_DI_PIN E2
#ifdef RGB_DI_PIN
#define RGBLED_NUM 16
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 10
#define RGBLIGHT_VAL_STEP 10
#define RGBLIGHT_ANIMATIONS
#endif
#endif

View File

@ -0,0 +1,25 @@
/* Copyright 2017 @TurboMech /u/TurboMech <discord> @A9entOran9e#6134
*
* 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 CONFIG_USER_H
#define CONFIG_USER_H
#define TAPPING_TOGGLE 2
#include "../../config.h"
// place overrides here
#endif

View File

@ -0,0 +1,182 @@
/* Copyright 2017 @TurboMech /u/TurboMech <discord> @A9entOran9e#6134
*
* 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 "alu84.h"
#include "turbomech.h"
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
#define _QWERTY 0 //BASE layer
#define _FUNCTION 1 //Function layer
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* BL
* ,- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -.
* | Esc | Scrn | Scrn | Expose |Launchpad| Show |Dock Hide| Screen | Shortcut| Shortcut| Shortcut| Shortcut| Play | Mute | Vol Up | Vol Down|
* | |Brght Up | Brght Dn| | | Desktop | Toggle | Capture | | | | | Pause | | | |
* |- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - -+- - - - -|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + | Backspace | POWER |
* | | | | | | | | | | | | | | | |
* |- - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - +- - - - -|
* | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | Shortcut|
* | | | | | | | | | | | | | | | |
* |- - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - - -+- - - - -|
* | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | Enter | Page |
* | | | | | | | | | | | | | | Up |
* |- - - - - - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - +- - - - -+- - - - -+
* | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Up | Page |
* | | | | | | | | | | | | | | Down |
* |- - - - - +- - - - - - +- - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -|
* | Control | Option | Gui | Space | Gui | Opt | Fn | Left | Down | Right |
* | | /Alt | | | | Alt | | | | |
* `- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'
*/
[_QWERTY] = KEYMAP(
KC_ESC, KC_F14, KC_F15, LCTL(KC_UP), LCTL(KC_L), KC_F11, LALT(LGUI(KC_D)), LCTL(KC_S), LCTL(LSFT(KC_O)), LCTL(LGUI(KC_1)), LCTL(LGUI(KC_2)), LCTL(LGUI(KC_3)), KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU,
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_BSPC, KC_POWER,
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, LCTL(LGUI(KC_N)),
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_ENT, KC_PGUP,
KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_PGDN,
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT),
/* FN1 - SEE readme.md
* ,- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -.
* | Quit | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Trns | Trns | DFU |
* | All | | | | | | | | | | | | | | | Reset |
* |- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - -+- - - - -|
* | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Delete | Lock |
* | | | | | | | | | | | | | | |Shortcut |
* |- - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - +- - - - -|
* | Trns | RGB | RGB | RGB | RGB | RGB Hue | RGB Hue | RGB Sat | RGB Sat | Trns | Trns | Trns | Trns | Trns | Trns |
* | | Toggle | Mode | Increase| Decrease| Increase| Decrease| Increase| Decrease| | | | | | |
* |- - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - - -+- - - - -|
* | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns |
* | | | | | | | | | | | | | | |
* |- - - - - - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - +- - - - -+- - - - -+
* | Trns |Backlight|Backlight|Backlight|Backlight| Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns |
* | | Toggle | Increase| Decrease| Step | | | | | | | | | |
* |- - - - - +- - - - - - +- - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -|
* | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns |
* | | | | | | | | | | |
* `- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'
*/
[_FUNCTION] = KEYMAP(
LALT(LGUI(KC_Q)), 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_TRNS, KC_TRNS, KC_RESET,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, LCTL(LALT(LGUI(KC_S))),
KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, BL_TOGG, BL_INC, BL_DEC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
//switch (id) {
// case _FLIP:
// if (record->event.pressed)
//SEND_STRING("(╯°□°)╯︵ ┻━┻");
// }
// return false;
// break;
// }
return MACRO_NONE;
};
switch (id) {
}
return MACRO_NONE;
}
void matrix_scan_user(void) {
}
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
DDRB |= (1 << 2); PORTB &= ~(1 << 2);
} else {
DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
}
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_COMPOSE)) {
} else {
}
if (usb_led & (1 << USB_LED_KANA)) {
} else {
}
}
enum function_id {
SHIFT_ESC,
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(SHIFT_ESC),
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t shift_esc_shift_mask;
switch (id) {
case SHIFT_ESC:
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
if (record->event.pressed) {
if (shift_esc_shift_mask) {
add_key(KC_GRV);
send_keyboard_report();
} else {
add_key(KC_ESC);
send_keyboard_report();
}
} else {
if (shift_esc_shift_mask) {
del_key(KC_GRV);
send_keyboard_report();
} else {
del_key(KC_ESC);
send_keyboard_report();
}
}
break;
}
}

View File

@ -0,0 +1,93 @@
# This is u/TurboMech's keyboard layout for ALU84.
## It is designed for Mac OS, due to the specific functions I created.
### Here is the layout found in the keymap.c file.
##### I use shortcuts for the Function row (above number row) listed below
- Scrn Bright Up: F14
- Scrn Bright Down: F15
- Expose: LCTRL + Up
- Launchpad: LCTRL + L
- Show Desktop: F11
- Show/Hide Dock: LALT + LGUI + D
- Screen Capture: LCTRL + S
- Custom Shortcut (setup for an application I use frequently): LCTRL + LSHFT + O
- Custom Shortcut 1: LCTRL + LGUI + 1
- Custom Shortcut 2: LCTRL + LGUI + 2
- Custom Shortcut 3: LCTRL + LGUI + 3
- use the custom shortcuts for whatever you want: launch an application, a macro, etc.
- Play/Pause: exactly that
- Mute / Volume Up / Volume Down: exactly what it says
##### Going down the right side from Vol Down:
- POWER: this serves as the power button on Mac's only. Press and hold the button as you would on your Macbook or iMac keyboard.
- Menu: this slides the notification bar on the right side (its the same as on iPhones/ iPads)
### See below keymaps for how to setup shortcuts on Mac
#### Base Layer
```
.- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -.
| Esc | Scrn | Scrn | Expose |Launchpad| Show |Dock Hide| Screen | Shortcut| Shortcut| Shortcut| Shortcut| Play | Mute | Vol Up | Vol Down|
| |Brght Up | Brght Dn| | | Desktop | Toggle | Capture | | | | | Pause | | | |
|- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - -+- - - - -|
| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + | Backspace | POWER |
| | | | | | | | | | | | | | | |
|- - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - +- - - - -|
| TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | Shortcut|
| | | | | | | | | | | | | | | |
|- - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - - -+- - - - -|
| CAPS | A | S | D | F | G | H | J | K | L | ; | ' | Enter | Page |
| | | | | | | | | | | | | | Up |
|- - - - - - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - +- - - - -+- - - - -+
| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Up | Page |
| | | | | | | | | | | | | | Down |
|- - - - - +- - - - - - +- - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -|
| Control | Option | Gui | Space | Gui | Opt | Fn | Left | Down | Right |
| | /Alt | | | | Alt | | | | |
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'
```
#### Function Layer 1 - See above for shortcuts
```
.- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -.
| Quit | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Trns | Trns | DFU |
| All | | | | | | | | | | | | | | | Reset |
|- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - -+- - - - -|
| Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Delete | Lock |
| | | | | | | | | | | | | | |Shortcut |
|- - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - +- - - - -|
| Trns | RGB | RGB | RGB | RGB | RGB Hue | RGB Hue | RGB Sat | RGB Sat | Trns | Trns | Trns | Trns | Trns | Trns |
| | Toggle | Mode | Increase| Decrease| Increase| Decrease| Increase| Decrease| | | | | | |
|- - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - - - -+- - - - -|
| Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns |
| | | | | | | | | | | | | | |
|- - - - - - - - - - - +- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - - - - - +- - - - -+- - - - -+
| Trns |Backlight|Backlight|Backlight|Backlight| Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns |
| | Toggle | Increase| Decrease| Step | | | | | | | | | |
|- - - - - +- - - - - - +- - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -+- - - - -|
| Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns |
| | | | | | | | | | |
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'
```
#### How to use/ setup shortcuts on Mac
- First navigate to System Preferences > Keyboard > Shortcuts
- You can use any of them in here
- Just set them to the shortcut keys listed above
#### How to make your own (to launch applications, quit all, etc.)
- Navigate to Automator > New Document > click Service > Choose
- Now we have to setup our shortcut
- Here's how to setup the Quit All Shortcut
- In the right window select the Service recieves dropdown > select No Input
- At the top left click the Name (Search) > type quit > click and hold Quit All Applications > drag to the right hand box (under the Service Recieves)
- **IMPORTANT** You have to click the Run button at the upper right hand corner in order for these to actually work.
- Now click File > Save > save it as Quit All Apps (or whatever you want) / you can also just exit out and it'll ask you if you want to save
- Navigate back to System Preferences > Keyboard > Shortcuts
- The new shortcut can be found under services, set it to one of the shortcuts I listed above and done
- The same applies for applications in the Name (search) just type the application you want to have as shortcut. Don't forget to run it, then do the same steps
to set it up as a shortcut.

View File

@ -0,0 +1,15 @@
BOOTMAGIC_ENABLE ?= yes # 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
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
AUDIO_ENABLE ?= no
RGBLIGHT_ENABLE ?= yes
UNICODE_ENABLE ?= yes
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View File

@ -0,0 +1,144 @@
#include "alu84.h"
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
#define _BL 0
#define _FN1 1
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* BL
* ,- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .
* | Esc | Scrn Brght Up | Scrn Bright Down | Expose | Launchpad | Show Desktop | Dock Hide Tog | Screen Capture | Shortcut | Shortcut | Shortcut| Shortcut | Play/Pause | Mute | Vol Up | Vol Down |
* |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + | Backspace | POWER |
* |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -|
* | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | Shortcut |
* |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -|
* | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | Enter | Pg Up |
* |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -|
* | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Up | Pg Dn |
* |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -|
* | Control | Option/Alt | Gui | Space | Gui | Opt | Fn (layer) | Left | Down | Right |
* `- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -'
*/
[_BL] = KEYMAP(
KC_ESC, KC_F14, KC_F15, LCTL(KC_UP), LCTL(KC_L), KC_F11, LALT(LGUI(KC_D)), LCTL(KC_S), LCTL(LSFT(KC_O)), LCTL(LGUI(KC_1)), LCTL(LGUI(KC_2)), LCTL(LGUI(KC_3)), KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU,
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_BSPC, KC_POWER,
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, LCTL(LGUI(KC_N)),
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_ENT, KC_PGUP,
KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_PGDN,
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT),
/* FN1
* ,- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .
* | Quit All | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Trns | Trns | DFU RESET |
* |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -|
* | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | DELETE | Lock Shrct |
* |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -|
* | Trns | RGB Toggle | RGB Mode | RGB Increase | RGB Decrease | RGB Hue Inc | RGB Hue Dec | RGB Sat Inc | RGB Sat Dec | Trns | Trns | Trns | Trns | Trns | Trns |
* |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -|
* | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns |
* |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -|
* | Trns | Backlight Tog | Backlight Inc | Backlight Dec | Backlight Step | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns |
* |- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -|
* | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns | Trns |
* `- - -+ - - - - - - - + - - - - - - - - -+ - - - -+ - - - - - + - - - - - - -+ - - - - - - - + - - - - - - - -+ - - - - -+ - - - - -+ - - - - + - - - - -+ - - - - - -+ - - -+ - - - -+ - - - - -'
*/
[_FN1] = KEYMAP(
LALT(LGUI(KC_Q)), 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_TRNS, KC_TRNS, RESET,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, LCTL(LALT(LGUI(KC_S))),
KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, BL_TOGG, BL_INC, BL_DEC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch (id) {
}
return MACRO_NONE;
}
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
DDRB |= (1 << 2); PORTB &= ~(1 << 2);
} else {
DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
}
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_COMPOSE)) {
} else {
}
if (usb_led & (1 << USB_LED_KANA)) {
} else {
}
}
enum function_id {
SHIFT_ESC,
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(SHIFT_ESC),
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
static uint8_t shift_esc_shift_mask;
switch (id) {
case SHIFT_ESC:
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
if (record->event.pressed) {
if (shift_esc_shift_mask) {
add_key(KC_GRV);
send_keyboard_report();
} else {
add_key(KC_ESC);
send_keyboard_report();
}
} else {
if (shift_esc_shift_mask) {
del_key(KC_GRV);
send_keyboard_report();
} else {
del_key(KC_ESC);
send_keyboard_report();
}
}
break;
}
}

View File

@ -0,0 +1,14 @@
ALU84
===
A 75% keyboard kit made and sold by mechkeys.ca [More info on mechkeys.ca](https://mechkeys.ca)
Keyboard Maintainer: [TurboMech](https://github.com/TurboMech)
Hardware Supported: ALU84
Hardware Availability: [mechkeys.ca](https://mechkeys.ca)
Make example for this keyboard (after setting up your build environment):
make alu84:default
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.

View File

@ -0,0 +1,56 @@
# MCU name
MCU = atmega32u4
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes*
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE ?= yes # 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
SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
AUDIO_ENABLE ?= no
RGBLIGHT_ENABLE ?= yes

View File

@ -0,0 +1,390 @@
/* Copyright 2017 @TurboMech /u/TurboMech <discord> @A9entOran9e#6134
*
* 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 "turbomech.h"
#include "quantum.h"
//#include "action_layer.h"
#include "action.h"
//#include "rgblight.h"
__attribute__ ((weak))
void matrix_init_keymap(void) {}
__attribute__ ((weak))
void matrix_scan_keymap(void) {}
__attribute__ ((weak))
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
return true;
}
__attribute__ ((weak))
uint32_t layer_state_set_keymap (uint32_t state) {
return state;
}
__attribute__ ((weak))
void led_set_keymap(uint8_t usb_led) {}
//#define default_layer _QWERTY (0)
//extern keymap_config_t keymap_config;
extern rgblight_config_t rgblight_config;
//#ifdef RGBLIGHT_ENABLE
/*change the rgblight_setrgb(#, #, #) to what you want CAPS lock - currenlty red*/
//#define rgblight_set_caps rgblight_setrgb(255, 0, 0)
//#define rgblight_base rgblight_mode(RGB_current_mode)
//#endif
//
//bool rgb_layer_change = true;
//bool RGB_INIT = false;
//bool TOG_STATUS = false;
#ifdef RGBLIGHT_ENABLE
bool rgb_layer_change = true;
#endif
int RGB_current_mode;
/*void matrix_init_user(void) {
#ifdef RGBLIGHT_ENABLE
rgblight_enable();
if (true) {
eeconfig_read_rgblight();
rgblight_get_mode();
eeconfig_update_rgblight_default();
// eeconfig_debug_rgblight();
//rgblight_init();
}
#endif
}
*/
/*void matrix_init_user(void) {
#ifdef RGBLIGHT_ENABLE
eeconfig_read_rgblight();
eeconfig_update_rgblight_default();
//rgblight_init();
//rgblight_mode(RGB_current_mode);
//rgblight_mode(RGB_current_mode);
//RGB_current_mode = rgblight_config.mode;
#endif
}*/
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
default_layer = _QWERTY;
// eeconfig_update_rgblight(rgblight_config.raw);
}
//Setting ADJUST layer RGB back to default
/*void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) {
rgblight_mode(RGB_current_mode);
layer_on(layer1);
} else {
layer_off(layer2);
}
}*/
void matrix_init_user(void) {
uint8_t default_layer = eeconfig_read_default_layer();
rgblight_enable();
if(true) {
if (default_layer & (1UL << _QWERTY)) {
//RGB_current_mode = rgblight_config.mode;
rgblight_mode(11);
}
else {
rgblight_mode (12);
}
/*else if (default_layer & (1UL << _DVORAK)) {
rgblight_set_green;
}
//else if (default_layer & (1UL << _WORKMAN)) {
rgblight_set_purple;
}
else {
rgblight_set_teal;*/
}
}
static bool is_capslocked = false;
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
is_capslocked = true;
// DDRB |= (1 << 2); PORTB &= ~(1 << 2);
} else {
is_capslocked = false;
// DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
}
}
//rgblight_set();
//static uint8_t is_capslocked = false;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case _QWERTY:
persistent_default_layer_set(1UL << _QWERTY);
return false;
break;
case KC_MAKE_ALU84:
if (!record->event.pressed) {
SEND_STRING("make alu84:TurboMech:dfu");
SEND_STRING(SS_TAP(X_ENTER));
}
return false;
break;
case KC_QMK:
if (!record->event.pressed) {
SEND_STRING("cd QMK/qmk_firmware");
SEND_STRING(SS_TAP(X_ENTER));
}
return false;
break;
case KC_RESET:
if (!record->event.pressed) {
#ifdef RGBLIGHT_ENABLE
rgblight_enable();
rgblight_mode(1);
rgblight_setrgb(255, 255, 255);
#endif
//_delay_ms(2000);
reset_keyboard();
}
return false;
break;
/*case RGB_MOD:
//led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released
if (record->event.pressed) {
rgblight_mode(RGB_current_mode);
RGB_current_mode = rgblight_config.mode;
rgblight_step();
// rgblight_mode(RGB_current_mode);
//RGB_current_mode = rgblight_config.mode;
// _delay_ms(50);
// rgblight_set();
RGB_current_mode = rgblight_config.mode;
}
else //if (rgblight_config.enable)
{
_delay_ms(50);
rgblight_set();
//rgblight_mode(rgblight_config.mode);
// eeconfig_update_rgblight(rgblight_config.raw);
}
return true;
break;*/
/*case MO(1):
if (record->event.realeased) {
rgblight_mode(1);
rgblight_set_red;
}
return true;
break;*/
/*case KC_CAPS:
if (record->event.pressed) {
rgblight_mode(RGB_current_mode);
register_code(KC_CAPS);
rgblight_mode(1);
rgblight_set_red;
}
else {
unregister_code(KC_CAPS);
rgblight_mode(RGB_current_mode);
}
return false;
break;*/
/* rgblight_mode(RGB_current_mode);
register_code(KC_CAPS);
rgblight_mode(1);
rgblight_set_red;
}
else {
unregister_code(KC_CAPS);
rgblight_mode(RGB_current_mode);*/
// }
// return true;
// break;
/*case KC_RESET:
if (record->event.pressed) {
layer_off(_FUNCTION);
rgblight_mode(RGB_current_mode);
RGB_current_mode = rgblight_config.mode;
layer_clear();
_delay_ms(1000);
reset_keyboard();
}
else{
//layer_off(_FUNCTION);
_delay_ms(1000);
rgblight_mode(RGB_current_mode);
RGB_current_mode = rgblight_config.mode;
//eeconfig_update_rgblight_default();
}
return false;
break;
}*/
return true;
break;
/*case RGB_MOD:
case RGB_SMOD:
case RGB_HUI:
case RGB_HUD:
case RGB_SAI:
case RGB_SAD:
case RGB_VAI:
case RGB_VAD:
case RGB_MODE_PLAIN:
case RGB_MODE_BREATHE:
case RGB_MODE_RAINBOW:
case RGB_MODE_SWIRL:
case RGB_MODE_SNAKE:
case RGB_MODE_KNIGHT:
case RGB_MODE_XMAS:
case RGB_MODE_GRADIENT:
if (record->event.pressed) {
rgb_layer_change = false;
}
break;
}
return true;*/
}
return process_record_keymap(keycode, record);
}
uint32_t layer_state_set_user(uint32_t state) {
#ifdef RGBLIGHT_ENABLE
uint8_t default_layer = eeconfig_read_default_layer();
if (rgb_layer_change) {
switch (biton32(state)) {
case _FUNCTION:
rgblight_set_blue;
rgblight_mode(1);
break;
case _QWERTY:
rgblight_mode(11);
break;
// case _MOUS:
// rgblight_set_yellow;
// rgblight_mode(1);
// break;
//case _MACROS:
//rgblight_set_orange;
//is_overwatch ? rgblight_mode(17) : rgblight_mode(18);
//break;
//case _MEDIA:
//rgblight_set_green;
//rgblight_mode(22);
//break;
default:
if (is_capslocked) {
rgblight_mode(1);
rgblight_set_red;
}
else { if (default_layer & (1UL << _QWERTY)) {
rgblight_mode(11);
}
else if (default_layer & (1UL << _FUNCTION)) {
rgblight_set_cyan;
}
//else if (default_layer & (1UL << _WORKMAN)) {
// rgblight_set_purple;
// }
else {
rgblight_set_orange;
}
}
rgblight_mode(1);
break;
}
}
#endif
return state;
}
!!** possible for later
void set_single_persistent_default_layer(uint8_t default_layer);
void set_single_persistent_default_layer(uint8_t default_layer) {
#if defined(AUDIO_ENABLE) && defined(DEFAULT_LAYER_SONGS)
PLAY_SONG(default_layer_songs[default_layer]);
#endif
eeconfig_update_default_layer(1U<<default_layer);
default_layer_set(1U<<default_layer);
void matrix_init_kb(void);
void matrix_init_user(void);
!!** line 31
__attribute__ ((weak))
void matrix_init_keymap(void) {}
__attribute__ ((weak))
void matrix_scan_keymap(void) {}
__attribute__ ((weak))
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
return true;
}
__attribute__ ((weak))
uint32_t layer_state_set_keymap (uint32_t state) {
return state;
}
__attribute__ ((weak))
void led_set_keymap(uint8_t usb_led) {}
Alt +30C4
¯\_()_/¯
Alt +00AF

View File

@ -0,0 +1,125 @@
/* Copyright 2017 @TurboMech /u/TurboMech <discord> @A9entOran9e#6134
*
* 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/>.
*/
//**!! Currently after reboot the set rgb mode does not persist after reboot. Need to find a way to "save" the rgb mode. Color remains after reboot though.
#include "turbomech.h"
#include "quantum.h"
#include "action_layer.h"
#include "action.h"
#include "rgblight.h"
//#include "process_unicode.h"
extern keymap_config_t keymap_config;
extern rgblight_config_t rgblight_config;
bool RGB_INIT = false;
bool TOG_STATUS = false;
bool caps_is_active = false;
int RGB_current_mode;
void matirx_scan_kb (void) {
if (RGB_INIT) {}
else {
RGB_current_mode = rgblight_config.mode;
RGB_INIT = true;
}
rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change
TOG_STATUS = false;
}
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
/*void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) {
rgblight_mode(RGB_current_mode);
layer_on(layer3);
} else {
layer_off(layer3);
}
}*/
__attribute__ ((weak))
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
return true;
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_CAPS:
if (record->event.pressed) {
register_code(KC_CAPS);
caps_is_active = !caps_is_active;
if (caps_is_active) {
rgblight_mode(14);
}
else if (!caps_is_active) {
unregister_code(KC_CAPS);
rgblight_mode(RGB_current_mode);
}
}
return false;
break;
case RGB_MOD:
//led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released
if (record->event.pressed) {
rgblight_mode(RGB_current_mode);
rgblight_step();
RGB_current_mode = rgblight_config.mode;
// rgblight_set();
}
return false;
break;
case KC_RESET:
if (record->event.pressed) {
rgblight_enable();
rgblight_mode(1);
rgblight_setrgb(255, 255, 255);
//_delay_ms(2000);
reset_keyboard();
}
return false;
break;
/*case _FLIP: //(╯°□°)╯︵ ┻━┻
if (record->event.pressed) {
register_code(KC_LPRN);
unregister_code(KC_LPRN);
register_code(X(0x00B0));
unregister_code(X(0x00B0));
UC(0x256F);
PROCESS_UNICODE(UC(0x00B0));
SEND_TAP(UC(0x25A1));
SEND_TAP(UC(0x00B0));
SEND_STRING(")");
SEND_TAP(UC(0x256F));
SEND_TAP(UC(0xFE35));
SEND_TAP(UC(0x253B));
SEND_TAP(UC(0x2501));
SEND_TAP(UC(0x253B));
}
return false;
break;*/
return true;
break;
}
return process_record_keymap(keycode, record);
}

View File

@ -0,0 +1,50 @@
/* Copyright 2017 @TurboMech /u/TurboMech <discord> @A9entOran9e#6134
*
* 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 USERSPACE
#define USERSPACE
#include "quantum.h"
// Definine layer names
#define _QWERTY 0
#define _FUNCTION 1
#ifdef RGBLIGHT_ENABLE
//values are HSV (Hue, Sat, Val) - except Sat and Val equal 255 for 100%.
#define rgblight_set_blue rgblight_sethsv (240, 255, 255);
#define rgblight_set_red rgblight_sethsv (0, 255, 255);
#define rgblight_set_green rgblight_sethsv (120, 255, 255);
#define rgblight_set_orange rgblight_sethsv (30, 255, 255);
#define rgblight_set_teal rgblight_sethsv (195, 255, 255);
#define rgblight_set_magenta rgblight_sethsv (300, 255, 255);
#define rgblight_set_yellow rgblight_sethsv (60, 255, 255);
#define rgblight_set_purple rgblight_sethsv (270, 255, 255);
#define rgblight_set_cyan rgblight_sethsv (180, 255, 255);
#define rgblight_set_white rgblight_sethsv (0, 0, 255)
#endif
//must use KC_RESET in order to have RESET indicate a color/mode
enum userspace_custom_keycodes {
EPRM = SAFE_RANGE, //should always be here
KC_RESET,
KC_MAKE_ALU84,
KC_QMK,
_FLIP,
NEW_SAFE_RANGE
};
#endif