Skip to content

Commit

Permalink
fixed things I broke and added an example
Browse files Browse the repository at this point in the history
added OS Condition example
  • Loading branch information
Dan committed Apr 11, 2021
1 parent 46cb54b commit 60b331f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
10 changes: 10 additions & 0 deletions README-adv.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Example: String OS = "Linux";
```
Otherwise, for auto-detection leave it blank.

You may also use the global variable ```OS``` within your hotkey definitions.

You can also dynamically set the HostOS at boot time by holding down one of the top 4 keys when the device powers on.
[1] = Windows, [2] = MacOS, [3] = Linux, [4] = Other

Expand Down Expand Up @@ -171,6 +173,14 @@ your OS, so use with caution. The Hack Hotkey also will most likely not be able
The code also does not properly identify mobile OS', and may identify them as Mac, Linux or unsure.
```c
Usage: osCondition("Windows Value","MacOS Value","Linux Value","Unsure");

Example:

String key5[] = {
"I love using my hacker hotkey on "+OS+"\n",
osCondition("yay Bill Gates!\n","yay Steve Jobs!\n","yay Linus Torvalds!\n","yay!\n")
};

```
Always include each argument even if it is a blank string ("");

Expand Down
8 changes: 4 additions & 4 deletions hackerHotKey/hackerHotKey.ino
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ void loop() {
delay(200);
}
else if (digitalRead(BTN5) == LOW) {
Keyboard.println("!vote 4\n");
Keyboard.println("!vote 4");
delay(200);
}
else if (digitalRead(BTN6) == LOW) {
Keyboard.println("!vote 3\n");
Keyboard.println("!vote 3");
delay(200);
}
else if (digitalRead(BTN7) == LOW) {
Keyboard.println("!vote 2\n");
Keyboard.println("!vote 2");
delay(200);
}
else if (digitalRead(BTN8) == LOW) {
Keyboard.println("!vote 1\n");
Keyboard.println("!vote 1");
delay(200);
}
}
10 changes: 9 additions & 1 deletion hackerhotkey-adv/hackerhotkey-adv.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
If you want to force Hacker Hotkey to act as if it's connected to a specific OS, set it here.
Valid options are "Windows", "MacOS", "Linux", "Other". Example: String OS = "Linux";
Otherwise, for auto-detection leave it blank.
You may also use the global varialbe "OS" within your hotkey definitions.
*/

String OS = "";
Expand Down Expand Up @@ -204,7 +206,13 @@ void defineHotkeys() {
your OS, so use with caution. The Hack Hotkey also will most likely not be able to identify a host within a VM.
The code also does not properly identify mobile OS', and may identify them as Mac, Linux or unsure.
Usage: osCondition("Windows Value","MacOS Value","Linux Value","Unsure");
Usage: osCondition("Windows Value","MacOS Value","Linux Value","Unsure")
Example:
String key5[] = {
"I love using my hacker hotkey on "+OS+"\n",
osCondition("yay bill gates!\n","yay Steve Jobs!\n","yay Linus Torvalds!\n","yay!\n")
};
Always include each argument even if it is a blank string ("");
Expand Down

0 comments on commit 60b331f

Please sign in to comment.