diff --git a/duckyinpython.py b/duckyinpython.py index e4a4562..d43a620 100644 --- a/duckyinpython.py +++ b/duckyinpython.py @@ -30,6 +30,15 @@ from adafruit_hid.keycode import Keycode #from keyboard_layout_win_LANG import KeyboardLayout as KeyboardLayout #from keycode_win_LANG import Keycode +def _capsOn(): + return kbd.led_on(Keyboard.LED_CAPS_LOCK) + +def _numOn(): + return kbd.led_on(Keyboard.LED_NUM_LOCK) + +def _scrollOn(): + return kbd.led_on(Keyboard.LED_SCROLL_LOCK) + duckyKeys = { 'WINDOWS': Keycode.GUI, 'RWINDOWS': Keycode.RIGHT_GUI, 'GUI': Keycode.GUI, 'RGUI': Keycode.RIGHT_GUI, 'COMMAND': Keycode.GUI, 'RCOMMAND': Keycode.RIGHT_GUI, 'APP': Keycode.APPLICATION, 'MENU': Keycode.APPLICATION, 'SHIFT': Keycode.SHIFT, 'RSHIFT': Keycode.RIGHT_SHIFT, @@ -63,6 +72,7 @@ duckyConsumerKeys = { } variables = {"$_RANDOM_MIN": 0, "$_RANDOM_MAX": 65535} +internalVariables = {"$_CAPSLOCK_ON": _capsOn, "$_NUMLOCK_ON": _numOn, "$_SCROLLLOCK_ON": _scrollOn} defines = {} functions = {} @@ -219,6 +229,8 @@ def sendString(line): def replaceVariables(line): for var in variables: line = line.replace(var, str(variables[var])) + for var in internalVariables: + line = line.replace(var, str(internalVariables[var]())) return line def replaceDefines(line):