|
|
|
/* -*- mode: c++ -*-
|
|
|
|
* Splitography -- A very basic Kaleidoscope example for the SOFT/HRUF Splitography keyboard
|
|
|
|
* Copyright (C) 2018 Keyboard.io, Inc
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "Kaleidoscope.h"
|
|
|
|
#include "Kaleidoscope-Steno.h"
|
|
|
|
|
|
|
|
enum {
|
|
|
|
_STENO,
|
|
|
|
};
|
|
|
|
|
|
|
|
// clang-format off
|
|
|
|
KEYMAPS(
|
|
|
|
|
|
|
|
/* Steno (GeminiPR)
|
|
|
|
* ,-----------------------. ,-----------------------.
|
|
|
|
* | # | # | # | # | # | # | | # | # | # | # | # | # |
|
|
|
|
* |---+---+---+---+---+---| |---+---+---+---+---+---|
|
|
|
|
* | | S | T | P | H | * | | * | F | P | L | T | D |
|
|
|
|
* |---+---+---+---+---+---| |---+---+---+---+---+---|
|
|
|
|
* | | S | K | W | R | * | | * | R | B | G | S | Z |
|
|
|
|
* `-------------+---+---+-' `-+---+---+-------------'
|
|
|
|
* | A | O | | E | U |
|
|
|
|
* `-------' `-------'
|
|
|
|
*/
|
|
|
|
[_STENO] = KEYMAP(
|
|
|
|
S(N1) ,S(N2) ,S(N3) ,S(N4) ,S(N5) ,S(N6) ,S(N7) ,S(N8) ,S(N9) ,S(NA) ,S(NB) ,S(NC)
|
|
|
|
,XXX ,S(S1) ,S(TL) ,S(PL) ,S(HL) ,S(ST1) ,S(ST3) ,S(FR) ,S(PR) ,S(LR) ,S(TR) ,S(DR)
|
|
|
|
,XXX ,S(S2) ,S(KL) ,S(WL) ,S(RL) ,S(ST2) ,S(ST4) ,S(RR) ,S(BR) ,S(GR) ,S(SR) ,S(ZR)
|
|
|
|
,S(A) ,S(O) ,S(E) ,S(U)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
KALEIDOSCOPE_INIT_PLUGINS(GeminiPR);
|
|
|
|
|
|
|
|
void setup() {
|
Redesign how the hardware objects are defined
Instead of having to define `HARDWARE_IMPLEMENTATION` to the class name of the
device, and define `KeyboardHardware` from within the plugin, let all devices
set `kaleidoscope::Device` to their own class via a typedef. Furthermore,
instead of `KeyboardHardware`, use `Kaleidoscope.device()` instead. This makes
device plugins a little bit simpler, and our naming more consistent.
Because some parts of the firmware need to access the device object before the
`Kaleidoscope` object is available, we can't make it a member of that. For this
reason, the device object is `kaleidoscope_internal::device`, and
`Kaleidoscope.device()` wraps it. In general, the wrapper should be used. But if
access to the device is required before `Kaleidoscope` is available, then that's
also available.
The `Kaleidoscope` object grew a few more wrappers: `storage()` and
`serialPort()`, so that one doesn't need to use `Kaleidoscope.device()`
directly, but can use the wrappers, which are noticably shorter to write.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
5 years ago
|
|
|
Kaleidoscope.serialPort().begin(9600);
|
|
|
|
Kaleidoscope.setup();
|
|
|
|
}
|
|
|
|
|
|
|
|
void loop() {
|
|
|
|
Kaleidoscope.loop();
|
|
|
|
}
|