Merge pull request #1225 from tlyu/fix-newlines

use CRLF for Focus newlines
pull/1226/head
Jesse Vincent 2 years ago committed by GitHub
commit 35aa03b63d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -54,8 +54,8 @@ EventHandlerResult AutoShiftConfig::onFocusEvent(const char *command) {
CATEGORIES,
} subCommand;
if (::Focus.handleHelp(command, PSTR("autoshift.enabled\n"
"autoshift.timeout\n"
if (::Focus.handleHelp(command, PSTR("autoshift.enabled\r\n"
"autoshift.timeout\r\n"
"autoshift.categories")))
return EventHandlerResult::OK;

@ -215,7 +215,7 @@ EventHandlerResult DynamicMacros::onNameQuery() {
}
EventHandlerResult DynamicMacros::onFocusEvent(const char *command) {
if (::Focus.handleHelp(command, PSTR("macros.map\nmacros.trigger")))
if (::Focus.handleHelp(command, PSTR("macros.map\r\nmacros.trigger")))
return EventHandlerResult::OK;
if (strncmp_P(command, PSTR("macros."), 7) != 0)

@ -102,7 +102,7 @@ void EEPROMKeymap::dumpKeymap(uint8_t layers, Key (*getkey)(uint8_t, KeyAddr)) {
}
EventHandlerResult EEPROMKeymap::onFocusEvent(const char *command) {
if (::Focus.handleHelp(command, PSTR("keymap.custom\nkeymap.default\nkeymap.onlyCustom")))
if (::Focus.handleHelp(command, PSTR("keymap.custom\r\nkeymap.default\r\nkeymap.onlyCustom")))
return EventHandlerResult::OK;
if (strncmp_P(command, PSTR("keymap."), 7) != 0)

@ -164,7 +164,7 @@ EventHandlerResult FocusSettingsCommand::onFocusEvent(const char *command) {
GET_CRC,
} sub_command;
if (::Focus.handleHelp(command, PSTR("settings.defaultLayer\nsettings.valid?\nsettings.version\nsettings.crc")))
if (::Focus.handleHelp(command, PSTR("settings.defaultLayer\r\nsettings.valid?\r\nsettings.version\r\nsettings.crc")))
return EventHandlerResult::OK;
if (strncmp_P(command, PSTR("settings."), 9) != 0)
@ -213,7 +213,7 @@ EventHandlerResult FocusEEPROMCommand::onFocusEvent(const char *command) {
ERASE,
} sub_command;
if (::Focus.handleHelp(command, PSTR("eeprom.contents\neeprom.free\neeprom.erase")))
if (::Focus.handleHelp(command, PSTR("eeprom.contents\r\neeprom.free\r\neeprom.erase")))
return EventHandlerResult::OK;
if (strcmp_P(command, PSTR("eeprom.contents")) == 0)

@ -100,7 +100,7 @@ EventHandlerResult FingerPainter::onFocusEvent(const char *command) {
CLEAR,
} sub_command;
if (::Focus.handleHelp(command, PSTR("fingerpainter.toggle\nfingerpainter.clear")))
if (::Focus.handleHelp(command, PSTR("fingerpainter.toggle\r\nfingerpainter.clear")))
return EventHandlerResult::OK;
if (strncmp_P(command, PSTR("fingerpainter."), 14) != 0)

@ -91,7 +91,7 @@ bool FocusSerial::handleHelp(const char *command,
}
EventHandlerResult FocusSerial::onFocusEvent(const char *command) {
if (handleHelp(command, PSTR("help\ndevice.reset\nplugins")))
if (handleHelp(command, PSTR("help\r\ndevice.reset\r\nplugins")))
return EventHandlerResult::OK;
if (strcmp_P(command, PSTR("device.reset")) == 0) {

@ -43,7 +43,7 @@ class FocusSerial : public kaleidoscope::Plugin {
EventHandlerResult sendName(const __FlashStringHelper *name) {
Runtime.serialPort().print(name);
delayAfterPrint();
Runtime.serialPort().print(NEWLINE);
Runtime.serialPort().println();
delayAfterPrint();
return EventHandlerResult::OK;
}

@ -34,7 +34,7 @@ namespace raise {
#endif
EventHandlerResult Focus::onFocusEvent(const char *command) {
if (::Focus.handleHelp(command, PSTR("hardware.version\nhardware.side_power\nhardware.side_ver\nhardware.sled_ver\nhardware.sled_current\nhardware.layout\nhardware.joint\nhardware.keyscan\nhardware.crc_errors\nhardware.firmware")))
if (::Focus.handleHelp(command, PSTR("hardware.version\r\nhardware.side_power\r\nhardware.side_ver\r\nhardware.sled_ver\r\nhardware.sled_current\r\nhardware.layout\r\nhardware.joint\r\nhardware.keyscan\r\nhardware.crc_errors\r\nhardware.firmware")))
return EventHandlerResult::OK;
if (strncmp_P(command, PSTR("hardware."), 9) != 0)
@ -65,7 +65,7 @@ EventHandlerResult Focus::onFocusEvent(const char *command) {
if (strcmp_P(command + 9, PSTR("side_ver")) == 0) {
::Focus.send("left:");
::Focus.send(Runtime.device().side.leftVersion());
::Focus.send("\nright:");
::Focus.send("\r\nright:");
::Focus.send(Runtime.device().side.rightVersion());
return EventHandlerResult::EVENT_CONSUMED;
}
@ -73,7 +73,7 @@ EventHandlerResult Focus::onFocusEvent(const char *command) {
if (strcmp_P(command + 9, PSTR("crc_errors")) == 0) {
::Focus.send("left:");
::Focus.send(Runtime.device().side.leftCRCErrors());
::Focus.send("\nright:");
::Focus.send("\r\nright:");
::Focus.send(Runtime.device().side.rightCRCErrors());
return EventHandlerResult::EVENT_CONSUMED;
}
@ -81,7 +81,7 @@ EventHandlerResult Focus::onFocusEvent(const char *command) {
if (strcmp_P(command + 9, PSTR("sled_ver")) == 0) {
::Focus.send("left:");
::Focus.send(Runtime.device().side.leftSLEDVersion());
::Focus.send("\nright:");
::Focus.send("\r\nright:");
::Focus.send(Runtime.device().side.rightSLEDVersion());
return EventHandlerResult::EVENT_CONSUMED;
}
@ -90,7 +90,7 @@ EventHandlerResult Focus::onFocusEvent(const char *command) {
if (::Focus.isEOL()) {
::Focus.send("left:");
::Focus.send(Runtime.device().side.leftSLEDCurrent());
::Focus.send("\nright:");
::Focus.send("\r\nright:");
::Focus.send(Runtime.device().side.rightSLEDCurrent());
return EventHandlerResult::EVENT_CONSUMED;
} else {

@ -33,8 +33,8 @@ EventHandlerResult LayerFocus::onNameQuery() {
}
EventHandlerResult LayerFocus::onFocusEvent(const char *command) {
if (::Focus.handleHelp(command, PSTR("layer.activate\nlayer.deactivate\nlayer.isActive"
"\nlayer.moveTo\nlayer.state")))
if (::Focus.handleHelp(command, PSTR("layer.activate\r\nlayer.deactivate\r\nlayer.isActive"
"\r\nlayer.moveTo\r\nlayer.state")))
return EventHandlerResult::OK;
if (strncmp_P(command, PSTR("layer."), 6) != 0)

@ -132,11 +132,11 @@ EventHandlerResult TypingBreaks::onSetup() {
return EventHandlerResult::OK;
}
#define FOCUS_HOOK_TYPINGBREAKS FOCUS_HOOK(TypingBreaks.focusHook, \
"typingbreaks.idleTimeLimit\n" \
"typingbreaks.lockTimeOut\n" \
"typingbreaks.lockLength\n" \
"typingbreaks.leftMaxKeys\n" \
#define FOCUS_HOOK_TYPINGBREAKS FOCUS_HOOK(TypingBreaks.focusHook, \
"typingbreaks.idleTimeLimit\r\n" \
"typingbreaks.lockTimeOut\r\n" \
"typingbreaks.lockLength\r\n" \
"typingbreaks.leftMaxKeys\r\n" \
"typingbreaks.rightMaxKeys")
EventHandlerResult TypingBreaks::onFocusEvent(const char *command) {
@ -148,10 +148,10 @@ EventHandlerResult TypingBreaks::onFocusEvent(const char *command) {
RIGHT_MAX,
} subCommand;
if (::Focus.handleHelp(command, PSTR("typingbreaks.idleTimeLimit\n"
"typingbreaks.lockTimeOut\n"
"typingbreaks.lockLength\n"
"typingbreaks.leftMaxKeys\n"
if (::Focus.handleHelp(command, PSTR("typingbreaks.idleTimeLimit\r\n"
"typingbreaks.lockTimeOut\r\n"
"typingbreaks.lockLength\r\n"
"typingbreaks.leftMaxKeys\r\n"
"typingbreaks.rightMaxKeys")))
return EventHandlerResult::OK;

@ -224,10 +224,10 @@ EventHandlerResult FocusLEDCommand::onFocusEvent(const char *command) {
if (!Runtime.has_leds)
return EventHandlerResult::OK;
if (::Focus.handleHelp(command, PSTR("led.at\n"
"led.setAll\n"
"led.mode\n"
"led.brightness\n"
if (::Focus.handleHelp(command, PSTR("led.at\r\n"
"led.setAll\r\n"
"led.mode\r\n"
"led.brightness\r\n"
"led.theme")))
return EventHandlerResult::OK;

Loading…
Cancel
Save