Comments (5)
Can you try this page to generate a layout, and tell me how it goes ?
https://www.neradoc.me/layouts/
from circuitpython_keyboard_layouts.
I'm Pretty Sure I Did Something Wrong But I Cant Figure Out What.This Is The Code.py File
from adafruit_hid.keyboard import Keyboard
import keyboard_layout_win_tuq
from keycode_win_tuq import Keycode
import time
import digitalio
from board import *
keyboard = Keyboard(usb_hid.devices)
# type with a layout
layout = keyboard_layout_win_tuq.KeyboardLayout(keyboard)
layout.write("Bonjour le monde")
# shortcuts with keycodes
keyboard.send(Keycode.LEFT_CONTROL, Keycode.A)
keyboard.send(Keycode.DELETE)
duckyCommands = ["WINDOWS", "GUI", "APP", "MENU", "SHIFT", "ALT", "CONTROL", "CTRL", "DOWNARROW", "DOWN",
"LEFTARROW", "LEFT", "RIGHTARROW", "RIGHT", "UPARROW", "UP", "BREAK", "PAUSE", "CAPSLOCK", "DELETE", "END",
"ESC", "ESCAPE", "HOME", "INSERT", "NUMLOCK", "PAGEUP", "PAGEDOWN", "PRINTSCREEN", "SCROLLLOCK", "SPACE",
"TAB", "ENTER", " a", " b", " c", " d", " e", " f", " g", " h", " i", " j", " k", " l", " m", " n", " o", " p", " q", " r", " s", " t",
" u", " v", " w", " x", " y", " z", " A", " B", " C", " D", " E", " F", " G", " H", " I", " J", " K", " L", " M", " N", " O", " P",
" Q", " R", " S", " T", " U", " V", " W", " X", " Y", " Z"]
keycodeCommands = [Keycode.WINDOWS, Keycode.GUI, Keycode.APPLICATION, Keycode.APPLICATION, Keycode.SHIFT, Keycode.ALT, Keycode.CONTROL,
Keycode.CONTROL, Keycode.DOWN_ARROW, Keycode.DOWN_ARROW ,Keycode.LEFT_ARROW, Keycode.LEFT_ARROW, Keycode.RIGHT_ARROW, Keycode.RIGHT_ARROW,
Keycode.UP_ARROW, Keycode.UP_ARROW, Keycode.PAUSE, Keycode.PAUSE, Keycode.CAPS_LOCK, Keycode.DELETE, Keycode.END, Keycode.ESCAPE,
Keycode.ESCAPE, Keycode.HOME, Keycode.INSERT, Keycode.KEYPAD_NUMLOCK, Keycode.PAGE_UP, Keycode.PAGE_DOWN, Keycode.PRINT_SCREEN,
Keycode.SCROLL_LOCK, Keycode.SPACE, Keycode.TAB, Keycode.ENTER, Keycode.A, Keycode.B, Keycode.C, Keycode.D, Keycode.E, Keycode.F, Keycode.G,
Keycode.H, Keycode.I, Keycode.J, Keycode.K, Keycode.L, Keycode.M, Keycode.N, Keycode.O, Keycode.P, Keycode.Q, Keycode.R, Keycode.S, Keycode.T,
Keycode.U, Keycode.V, Keycode.W, Keycode.X, Keycode.Y, Keycode.Z, Keycode.A, Keycode.B, Keycode.C, Keycode.D, Keycode.E, Keycode.F,
Keycode.G, Keycode.H, Keycode.I, Keycode.J, Keycode.K, Keycode.L, Keycode.M, Keycode.N, Keycode.O, Keycode.P,
Keycode.Q, Keycode.R, Keycode.S, Keycode.T, Keycode.U, Keycode.V, Keycode.W, Keycode.X, Keycode.Y, Keycode.Z]
def convertLine(line):
newline = []
print(line)
for j in range(len(keycodeCommands)):
if line.find(duckyCommands[j]) != -1:
newline.append(keycodeCommands[j])
print(newline)
return newline
def runScriptLine(line):
for k in line:
kbd.press(k)
kbd.release_all()
def sendString(line):
layout.write(line)
def parseLine(line):
if(line[0:3] == "REM"):
# ignore ducky script comments
print("")
elif(line[0:5] == "DELAY"):
time.sleep(float(line[6:])/1000)
elif(line[0:6] == "STRING"):
sendString(line[7:])
elif(line[0:13] == "DEFAULT_DELAY"):
defaultDelay = int(line[14:]) * 10
elif(line[0:12] == "DEFAULTDELAY"):
defaultDelay = int(line[13:]) * 10
else:
newScriptLine = convertLine(line)
runScriptLine(newScriptLine)
kbd = Keyboard(usb_hid.devices)
layout = KeyboardLayoutUS(kbd)
# sleep at the start to allow the device to be recognized by the host computer
time.sleep(.5)
# check GP0 for setup mode
# see setup mode for instructions
progStatus = False
progStatusPin = digitalio.DigitalInOut(GP0)
progStatusPin.switch_to_input(pull=digitalio.Pull.UP)
progStatus = progStatusPin.value
defaultDelay = 0
if(progStatus == True):
# not in setup mode, inject the payload
duckyScriptPath = "payload.dd"
f = open(duckyScriptPath,"r",encoding='utf-8')
print("Running payload.dd")
previousLine = ""
duckyScript = f.readlines()
for line in duckyScript:
line = line.rstrip()
if(line[0:6] == "REPEAT"):
for i in range(int(line[7:])):
#repeat the last command
parseLine(previousLine)
time.sleep(float(defaultDelay)/1000)
else:
parseLine(line)
previousLine = line
time.sleep(float(defaultDelay)/1000)
print("Done")
else:
print("Update your payload")
from circuitpython_keyboard_layouts.
Don't put the sample code in the ducky code, follow the changes over there (changing "da" to "tuq")
dbisu/pico-ducky#10 (comment)
from circuitpython_keyboard_layouts.
I Tested Almost Every Single Key And It Seems to Be Working Perfectly Fine.Thanks A Lot!
Here Are The Files If Anyone Needs It:
tr_keyboard_layout.zip
from circuitpython_keyboard_layouts.
Ok, I'll integrate them in the repository in a future release. Thanks for testing. 👍
from circuitpython_keyboard_layouts.
Related Issues (20)
- What do I have to change in the code.py file? HOT 1
- Backslash not working HOT 3
- Doesnt Work, with es layout HOT 2
- Can I Use This In My Repository? HOT 2
- TR not working HOT 1
- TR lang "i" Problem HOT 5
- dont work HOT 3
- curly braces not working on the Italian keyboard HOT 2
- Missing CH layout
- DE not working
- Cannot generate the FR-Bépo layout HOT 4
- Japanese keyboard (106n) is not available.
- I fail to add bundle with circup 1.4.0 HOT 1
- Which files to use for "BE" layout
- Please add support for CircuitPython 9.x HOT 1
- Dvorak layout Shift R == Shift Q
- tuple for HIGHER_ASCII for use dead key HOT 12
- Where to paste that code or how to change the keyboard layout using the pico as an HID? HOT 1
- Trying to change my default US layout to SP layout HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from circuitpython_keyboard_layouts.