Remove run_on_msc feature

This commit is contained in:
Spacehuhn 2022-11-07 21:34:43 +01:00
parent 7d63bf2846
commit abf045f96c
3 changed files with 4 additions and 14 deletions

View File

@ -100,7 +100,7 @@ void setup() {
selector::changed(); selector::changed();
// Start attack // Start attack
if (selector::mode() == ATTACK && !preferences::getRunOnIndicator() && !preferences::getRunOnMSC()) { if (selector::mode() == ATTACK && !preferences::getRunOnIndicator()) {
delay(preferences::getInitialDelay()); // Wait to give computer time to init keyboard delay(preferences::getInitialDelay()); // Wait to give computer time to init keyboard
attack::start(); // Start keystroke injection attack attack::start(); // Start keystroke injection attack
led::setColor(preferences::getIdleColor()); // Set LED to green led::setColor(preferences::getIdleColor()); // Set LED to green
@ -113,13 +113,13 @@ void setup() {
} }
void loop() { void loop() {
tasks::update(); taks:update();
cli::update(); cli::update();
if(selector::read() != ATTACK) return; if(selector::read() != ATTACK) return;
// Only start the attack if run-on-indicator is disabled, or indicator actually changed // Only start the attack if run-on-indicator is disabled, or indicator actually changed
if((preferences::getRunOnIndicator() && hid::indicatorChanged()) || (preferences::getRunOnMSC() && msc::changed())) { if(preferences::getRunOnIndicator() && hid::indicatorChanged()) {
attack::start(); // Run script attack::start(); // Run script
led::setColor(preferences::getIdleColor()); // Set LED to green led::setColor(preferences::getIdleColor()); // Set LED to green
// Don't run again // Don't run again

View File

@ -49,7 +49,6 @@ namespace preferences {
bool disable_capslock { true }; bool disable_capslock { true };
bool run_on_indicator { false }; bool run_on_indicator { false };
bool run_on_msc { false };
int initial_delay { 1000 }; int initial_delay { 1000 };
@ -95,7 +94,6 @@ namespace preferences {
*/ */
root["disable_capslock"] = disable_capslock; root["disable_capslock"] = disable_capslock;
root["run_on_indicator"] = run_on_indicator; root["run_on_indicator"] = run_on_indicator;
root["run_on_msc"] = run_on_msc;
root["initial_delay"] = initial_delay; root["initial_delay"] = initial_delay;
} }
@ -149,7 +147,6 @@ namespace preferences {
*/ */
if (!config_doc.containsKey("disable_capslock")) config_doc["disable_capslock"] = disable_capslock; if (!config_doc.containsKey("disable_capslock")) config_doc["disable_capslock"] = disable_capslock;
if (!config_doc.containsKey("run_on_indicator")) config_doc["run_on_indicator"] = run_on_indicator; if (!config_doc.containsKey("run_on_indicator")) config_doc["run_on_indicator"] = run_on_indicator;
if (!config_doc.containsKey("run_on_msc")) config_doc["run_on_msc"] = run_on_msc;
if (!config_doc.containsKey("initial_delay")) config_doc["initial_delay"] = initial_delay; if (!config_doc.containsKey("initial_delay")) config_doc["initial_delay"] = initial_delay;
@ -185,7 +182,6 @@ namespace preferences {
disable_capslock = config_doc["disable_capslock"].as<bool>(); disable_capslock = config_doc["disable_capslock"].as<bool>();
run_on_indicator = config_doc["run_on_indicator"].as<bool>(); run_on_indicator = config_doc["run_on_indicator"].as<bool>();
run_on_msc = config_doc["run_on_msc"].as<bool>();
initial_delay = config_doc["initial_delay"].as<int>(); initial_delay = config_doc["initial_delay"].as<int>();
} }
@ -251,7 +247,6 @@ namespace preferences {
disable_capslock = true; disable_capslock = true;
run_on_indicator = false; run_on_indicator = false;
run_on_msc = false;
initial_delay = 1000; initial_delay = 1000;
} }
@ -357,10 +352,6 @@ namespace preferences {
return run_on_indicator; return run_on_indicator;
} }
bool getRunOnMSC() {
return run_on_msc;
}
int getInitialDelay() { int getInitialDelay() {
return initial_delay; return initial_delay;
} }

View File

@ -38,7 +38,6 @@ namespace preferences {
bool getDisableCapslock(); bool getDisableCapslock();
bool getRunOnIndicator(); bool getRunOnIndicator();
bool getRunOnMSC();
int getInitialDelay(); int getInitialDelay();
} }