You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
144 lines
4.9 KiB
144 lines
4.9 KiB
6 years ago
|
/* -*- mode: c++ -*-
|
||
5 years ago
|
* Atreus -- Chrysalis-enabled Sketch for the Keyboardio Atreus
|
||
5 years ago
|
* Copyright (C) 2018, 2019 Keyboard.io, Inc
|
||
6 years ago
|
*
|
||
|
* 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, write to the Free Software Foundation, Inc.,
|
||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||
|
*/
|
||
|
|
||
4 years ago
|
#ifndef BUILD_INFORMATION
|
||
3 years ago
|
#define BUILD_INFORMATION "locally built on " __DATE__ " at " __TIME__
|
||
4 years ago
|
#endif
|
||
|
|
||
6 years ago
|
#include "Kaleidoscope.h"
|
||
5 years ago
|
#include "Kaleidoscope-EEPROM-Settings.h"
|
||
|
#include "Kaleidoscope-EEPROM-Keymap.h"
|
||
|
#include "Kaleidoscope-FocusSerial.h"
|
||
6 years ago
|
#include "Kaleidoscope-Macros.h"
|
||
5 years ago
|
#include "Kaleidoscope-MouseKeys.h"
|
||
|
#include "Kaleidoscope-OneShot.h"
|
||
|
#include "Kaleidoscope-Qukeys.h"
|
||
|
#include "Kaleidoscope-SpaceCadet.h"
|
||
|
|
||
|
|
||
6 years ago
|
#define MO(n) ShiftToLayer(n)
|
||
|
#define TG(n) LockLayer(n)
|
||
|
|
||
|
enum {
|
||
4 years ago
|
MACRO_QWERTY,
|
||
|
MACRO_VERSION_INFO
|
||
6 years ago
|
};
|
||
|
|
||
|
#define Key_Exclamation LSHIFT(Key_1)
|
||
3 years ago
|
#define Key_At LSHIFT(Key_2)
|
||
|
#define Key_Hash LSHIFT(Key_3)
|
||
|
#define Key_Dollar LSHIFT(Key_4)
|
||
|
#define Key_Percent LSHIFT(Key_5)
|
||
|
#define Key_Caret LSHIFT(Key_6)
|
||
|
#define Key_And LSHIFT(Key_7)
|
||
|
#define Key_Star LSHIFT(Key_8)
|
||
|
#define Key_Plus LSHIFT(Key_Equals)
|
||
6 years ago
|
|
||
5 years ago
|
enum {
|
||
|
QWERTY,
|
||
5 years ago
|
FUN,
|
||
|
UPPER
|
||
5 years ago
|
};
|
||
|
|
||
3 years ago
|
// clang-format off
|
||
6 years ago
|
KEYMAPS(
|
||
5 years ago
|
[QWERTY] = KEYMAP_STACKED
|
||
6 years ago
|
(
|
||
|
Key_Q ,Key_W ,Key_E ,Key_R ,Key_T
|
||
|
,Key_A ,Key_S ,Key_D ,Key_F ,Key_G
|
||
5 years ago
|
,Key_Z ,Key_X ,Key_C ,Key_V ,Key_B, Key_Backtick
|
||
6 years ago
|
,Key_Esc ,Key_Tab ,Key_LeftGui ,Key_LeftShift ,Key_Backspace ,Key_LeftControl
|
||
|
|
||
5 years ago
|
,Key_Y ,Key_U ,Key_I ,Key_O ,Key_P
|
||
|
,Key_H ,Key_J ,Key_K ,Key_L ,Key_Semicolon
|
||
|
,Key_Backslash,Key_N ,Key_M ,Key_Comma ,Key_Period ,Key_Slash
|
||
5 years ago
|
,Key_LeftAlt ,Key_Space ,MO(FUN) ,Key_Minus ,Key_Quote ,Key_Enter
|
||
6 years ago
|
),
|
||
|
|
||
5 years ago
|
[FUN] = KEYMAP_STACKED
|
||
6 years ago
|
(
|
||
5 years ago
|
Key_Exclamation ,Key_At ,Key_UpArrow ,Key_Dollar ,Key_Percent
|
||
|
,Key_LeftParen ,Key_LeftArrow ,Key_DownArrow ,Key_RightArrow ,Key_RightParen
|
||
|
,Key_LeftBracket ,Key_RightBracket ,Key_Hash ,Key_LeftCurlyBracket ,Key_RightCurlyBracket ,Key_Caret
|
||
5 years ago
|
,TG(UPPER) ,Key_Insert ,Key_LeftGui ,Key_LeftShift ,Key_Delete ,Key_LeftControl
|
||
6 years ago
|
|
||
5 years ago
|
,Key_PageUp ,Key_7 ,Key_8 ,Key_9 ,Key_Backspace
|
||
|
,Key_PageDown ,Key_4 ,Key_5 ,Key_6 ,___
|
||
|
,Key_And ,Key_Star ,Key_1 ,Key_2 ,Key_3 ,Key_Plus
|
||
5 years ago
|
,Key_LeftAlt ,Key_Space ,___ ,Key_Period ,Key_0 ,Key_Equals
|
||
6 years ago
|
),
|
||
|
|
||
5 years ago
|
[UPPER] = KEYMAP_STACKED
|
||
6 years ago
|
(
|
||
4 years ago
|
Key_Insert ,Key_Home ,Key_UpArrow ,Key_End ,Key_PageUp
|
||
|
,Key_Delete ,Key_LeftArrow ,Key_DownArrow ,Key_RightArrow ,Key_PageDown
|
||
|
,M(MACRO_VERSION_INFO) ,Consumer_VolumeIncrement ,XXX ,XXX ,___ ,___
|
||
|
,MoveToLayer(QWERTY) ,Consumer_VolumeDecrement ,___ ,___ ,___ ,___
|
||
4 years ago
|
|
||
|
,Key_UpArrow ,Key_F7 ,Key_F8 ,Key_F9 ,Key_F10
|
||
|
,Key_DownArrow ,Key_F4 ,Key_F5 ,Key_F6 ,Key_F11
|
||
|
,___ ,XXX ,Key_F1 ,Key_F2 ,Key_F3 ,Key_F12
|
||
|
,___ ,___ ,MoveToLayer(QWERTY) ,Key_PrintScreen ,Key_ScrollLock ,Consumer_PlaySlashPause
|
||
6 years ago
|
)
|
||
|
)
|
||
3 years ago
|
// clang-format on
|
||
6 years ago
|
|
||
5 years ago
|
KALEIDOSCOPE_INIT_PLUGINS(
|
||
|
EEPROMSettings,
|
||
|
EEPROMKeymap,
|
||
|
Focus,
|
||
|
FocusEEPROMCommand,
|
||
|
FocusSettingsCommand,
|
||
4 years ago
|
Qukeys,
|
||
5 years ago
|
SpaceCadet,
|
||
4 years ago
|
OneShot,
|
||
5 years ago
|
Macros,
|
||
3 years ago
|
MouseKeys);
|
||
6 years ago
|
|
||
4 years ago
|
const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) {
|
||
|
if (keyToggledOn(event.state)) {
|
||
|
switch (macro_id) {
|
||
|
case MACRO_QWERTY:
|
||
|
// This macro is currently unused, but is kept around for compatibility
|
||
|
// reasons. We used to use it in place of `MoveToLayer(QWERTY)`, but no
|
||
|
// longer do. We keep it so that if someone still has the old layout with
|
||
|
// the macro in EEPROM, it will keep working after a firmware update.
|
||
|
Layer.move(QWERTY);
|
||
|
break;
|
||
|
case MACRO_VERSION_INFO:
|
||
4 years ago
|
Macros.type(PSTR("Keyboardio Atreus - Kaleidoscope "));
|
||
|
Macros.type(PSTR(BUILD_INFORMATION));
|
||
4 years ago
|
break;
|
||
|
default:
|
||
|
break;
|
||
4 years ago
|
}
|
||
6 years ago
|
}
|
||
|
return MACRO_NONE;
|
||
|
}
|
||
|
|
||
|
void setup() {
|
||
|
Kaleidoscope.setup();
|
||
5 years ago
|
SpaceCadet.disable();
|
||
5 years ago
|
EEPROMKeymap.setup(10);
|
||
6 years ago
|
}
|
||
|
|
||
|
void loop() {
|
||
|
Kaleidoscope.loop();
|
||
|
}
|