Skip to content

Commit

Permalink
Adding DEFAULT_DELAY or DEFAULTDELAY support
Browse files Browse the repository at this point in the history
  • Loading branch information
gg64du02 committed May 30, 2018
1 parent d78700a commit 972d273
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

# TODO: try most scripts available with hak5's payloads

# TODO: add the support of DEFAULT_DELAY

# TODO: make a video about it ?

# TODO:Add an info button next to it when the RAM usage guess is RED.
Expand Down Expand Up @@ -86,6 +84,8 @@ w/ proper stylesheet ?

# DONE: correcting style sheet in the error textarea and removing console message in the log area

# DONE: add the support of DEFAULT_DELAY

# =============================================================

# DON'T/CAN'T DO IT: multiOS script on 7 would change back the keyboard layout settings to the primary one set in 7
Expand Down
33 changes: 33 additions & 0 deletions duckSpark.js_files/duckSpark.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ class Dckuinojs {
//gg64du02
//debugger purpose
numbers_of_character = 0;

//gg64du02 2018
var param_DEFAULT_DELAY = '0';

// Loop every line
for (var i = 0; i < lineArray.length; i++)
Expand Down Expand Up @@ -256,6 +259,29 @@ class Dckuinojs {

// Handle commands
switch(wordOne){
//DEFAULT_DELAY
//gg64du02 2018
case "DEFAULT_DELAY":
case "DEFAULTDELAY":
wordArray.shift();

var textString = wordArray.join(' ');

// Replace all '"' by '\"' and all '\' by '\\'
textString = textString.split('\\').join('\\\\').split('"').join('\\"');
if (textString !== '')
{
//parsedOut += ' DigiKeyboard.println("' + textString + '");\n';
commandKnown = true;
param_DEFAULT_DELAY = textString;
//gg64du02
//debugger purpose
numbers_of_character = numbers_of_character + textString.length;
} else {
console.error('Error: at line: ' + (i + 1) + ', DEFAULT_DELAY needs a number');
return;
}
break;
case "STRING":
wordArray.shift();

Expand Down Expand Up @@ -503,6 +529,13 @@ class Dckuinojs {

}
}

//support of default delay
//gg64du02
console.log("param_DEFAULT_DELAY:"+param_DEFAULT_DELAY);
if(parseInt(param_DEFAULT_DELAY) !==0){
parsedOut +=' DigiKeyboard.delay(' + param_DEFAULT_DELAY + ');\n';
}

if (!commandKnown)
{
Expand Down

0 comments on commit 972d273

Please sign in to comment.