Skip to content

Commit

Permalink
Merge pull request #16 from arrase/upper_and_lower
Browse files Browse the repository at this point in the history
Upper and lower
  • Loading branch information
arrase authored Apr 19, 2017
2 parents b3ad734 + 3f41c4b commit 5cb1780
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ducky/RaspiDucky/DuckyScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ def _getKBCode(self, char):
try:
return kb.KEYBOARD_LAYOUT[char]
except KeyError:
return char.lower()
if char.isupper():
return "left-shift " + char.lower()
else:
return char.lower()

def _exec_code(self, code, code_type="keyboard"):
p1 = subprocess.Popen(["echo", code], stdout=subprocess.PIPE)
Expand Down Expand Up @@ -60,10 +63,10 @@ def run(self, cmd):
self._exec_code(self._getKBCode(c))
elif (cmd[0] == "DELAY"):
self._last_cmd = "UNS"
sleep(float(cmd[1]) / 1000000.0)
sleep(float(cmd[1]) / 1000.0)
elif cmd[0] in ["DEFAULTDELAY", "DEFAULT_DELAY"]:
self._last_cmd = "UNS"
self._def_delay = float(cmd[1]) / 1000000.0
self._def_delay = float(cmd[1]) / 1000.0
elif (cmd[0] == "REM"):
self._last_cmd = "REM"
print(cmd[1])
Expand Down

0 comments on commit 5cb1780

Please sign in to comment.