I ended up doing this with leader sequences instead, with leader + letter outputting full stop, space, capital of that letter. Here is the code, it’s just for full stop space capitalise, but it should be easy to adapt to your other cases with some search and replace. I included a leader + space sequence that doesn’t output a letter at all for when a non-capital starts the sentence, like “iPhone” or numbers or symbols. I made the leader time-out quite large for my own preference, others might not like it that high.
#include “Kaleidoscope-Leader.h”
// somewhere in keymap - LEAD(0)
static void leaderFSA(uint8_t seq_index) {
Macros.type(PSTR(". A"));
}
static void leaderFSB(uint8_t seq_index) {
Macros.type(PSTR(". B"));
}
static void leaderFSC(uint8_t seq_index) {
Macros.type(PSTR(". C"));
}
static void leaderFSD(uint8_t seq_index) {
Macros.type(PSTR(". D"));
}
static void leaderFSE(uint8_t seq_index) {
Macros.type(PSTR(". E"));
}
static void leaderFSF(uint8_t seq_index) {
Macros.type(PSTR(". F"));
}
static void leaderFSG(uint8_t seq_index) {
Macros.type(PSTR(". G"));
}
static void leaderFSH(uint8_t seq_index) {
Macros.type(PSTR(". H"));
}
static void leaderFSI(uint8_t seq_index) {
Macros.type(PSTR(". I"));
}
static void leaderFSJ(uint8_t seq_index) {
Macros.type(PSTR(". J"));
}
static void leaderFSK(uint8_t seq_index) {
Macros.type(PSTR(". K"));
}
static void leaderFSL(uint8_t seq_index) {
Macros.type(PSTR(". L"));
}
static void leaderFSM(uint8_t seq_index) {
Macros.type(PSTR(". M"));
}
static void leaderFSN(uint8_t seq_index) {
Macros.type(PSTR(". N"));
}
static void leaderFSO(uint8_t seq_index) {
Macros.type(PSTR(". O"));
}
static void leaderFSP(uint8_t seq_index) {
Macros.type(PSTR(". P"));
}
static void leaderFSQ(uint8_t seq_index) {
Macros.type(PSTR(". Q"));
}
static void leaderFSR(uint8_t seq_index) {
Macros.type(PSTR(". R"));
}
static void leaderFSS(uint8_t seq_index) {
Macros.type(PSTR(". S"));
}
static void leaderFST(uint8_t seq_index) {
Macros.type(PSTR(". T"));
}
static void leaderFSU(uint8_t seq_index) {
Macros.type(PSTR(". U"));
}
static void leaderFSV(uint8_t seq_index) {
Macros.type(PSTR(". V"));
}
static void leaderFSW(uint8_t seq_index) {
Macros.type(PSTR(". W"));
}
static void leaderFSX(uint8_t seq_index) {
Macros.type(PSTR(". X"));
}
static void leaderFSY(uint8_t seq_index) {
Macros.type(PSTR(". Y"));
}
static void leaderFSZ(uint8_t seq_index) {
Macros.type(PSTR(". Z"));
}
static void leaderFS(uint8_t seq_index) {
Macros.type(PSTR(". "));
}
static const kaleidoscope::Leader::dictionary_t leader_dictionary[] PROGMEM =
LEADER_DICT({LEADER_SEQ(LEAD(0), Key_A), leaderFSA},
{LEADER_SEQ(LEAD(0), Key_B), leaderFSB},
{LEADER_SEQ(LEAD(0), Key_C), leaderFSC},
{LEADER_SEQ(LEAD(0), Key_D), leaderFSD},
{LEADER_SEQ(LEAD(0), Key_E), leaderFSE},
{LEADER_SEQ(LEAD(0), Key_F), leaderFSF},
{LEADER_SEQ(LEAD(0), Key_G), leaderFSG},
{LEADER_SEQ(LEAD(0), Key_H), leaderFSH},
{LEADER_SEQ(LEAD(0), Key_I), leaderFSI},
{LEADER_SEQ(LEAD(0), Key_J), leaderFSJ},
{LEADER_SEQ(LEAD(0), Key_K), leaderFSK},
{LEADER_SEQ(LEAD(0), Key_L), leaderFSL},
{LEADER_SEQ(LEAD(0), Key_M), leaderFSM},
{LEADER_SEQ(LEAD(0), Key_N), leaderFSN},
{LEADER_SEQ(LEAD(0), Key_O), leaderFSO},
{LEADER_SEQ(LEAD(0), Key_P), leaderFSP},
{LEADER_SEQ(LEAD(0), Key_Q), leaderFSQ},
{LEADER_SEQ(LEAD(0), Key_R), leaderFSR},
{LEADER_SEQ(LEAD(0), Key_S), leaderFSS},
{LEADER_SEQ(LEAD(0), Key_T), leaderFST},
{LEADER_SEQ(LEAD(0), Key_U), leaderFSU},
{LEADER_SEQ(LEAD(0), Key_V), leaderFSV},
{LEADER_SEQ(LEAD(0), Key_W), leaderFSW},
{LEADER_SEQ(LEAD(0), Key_X), leaderFSX},
{LEADER_SEQ(LEAD(0), Key_Y), leaderFSY},
{LEADER_SEQ(LEAD(0), Key_Z), leaderFSZ},
{LEADER_SEQ(LEAD(0), Key_Spacebar), leaderFS});
KALEIDOSCOPE_INIT_PLUGINS(
Leader,
)
void setup() {
Kaleidoscope.setup();
Leader.dictionary = leader_dictionary;
Leader.time_out = 5000;