Flowm / etherkey

Emulate a conventional USB keyboard with a scriptable, network capable microcontroller.
MIT License
133 stars 22 forks source link

Etherkey

Emulate a conventional USB keyboard with a scriptable network capable microcontroller.

By using dedicated hardware it is possible to control systems even before the operating system is booted and without being dependent on the running software. For example this allows automatic bootloder selectios or modification of BIOS settings.

Requirements

Setup

a) Direct connection to Teensy

You may connect directly to the Teensy, using a USB-to-UART Adapter.

Connect Ground to Teensy's GND-Pin, TX to Pin 0, RX to Pin 1.

Now you can use any tool you like to connect to the Teensy. Baudrate is 57600, device most likely /dev/ttyUSB0 on Linux/UNIX. For example: cu -l /dev/ttyUSB0 -s 57600

b) Using a Raspberry PI for Network features

Example setup with a Raspberry PI for the ethernet connection.

Connect GND of the Raspberry to Teensy's GND-Pin, TX to Pin 0, RX to Pin 1.

When using Raspbian as operating system, the serial port must be configured for outgoing connections. After that a serial connection can be established with cu -l /dev/ttyAMA0 -s 57600. On newer Raspberry PI or Raspbian versions you might need to use /dev/serial0 instead.

Usage and Syntax

Mode selection

Ctrl+Q to switch between modes.

Available modes:

Interactive mode

Directly sends the recieved keystroke Supported Characters:

Command mode

Parses the whole line and interprets the first Word as command. Available commands:

SendRaw

Sends the rest of the line literally

Send

Sends the rest of the line while interpreting special characters. This command behaves similarly to the send command of AutoHotkey

Modifiers

The following characters are treated as modifiers:

These modifiers can be combined, so a ^+t would send a CTRL+SHIFT+t, thus restoring the last tab in Firefox.

Keynames

Non printable characters can be sent by specifying the keyname enclosed in braces:

These keynames can also be combined with modifiers. For example Send ^!{Delete} sends the CTRL+SHIFT+Delete combination.

Escape sequence

To send a single character literally, it can be enclosed in braces:

This syntax can also be used to repeat a keystroke multiple times:

Enclose the character or keyname followed by a whitespace and the number of repetitions in braces.

Unicode characters

Arbitrary Unicode characters can be sent by specifying the 4-digit character code after the operating system specific command:

UnicodeLinux or UCL

Initializes the GKT+/Qt Unicode Sequence and sends the following 4-digit hexadecimal Unicode Character.

UnicodeWindows or UCW (experimental)

Initializes the Windows Unicode Sequence and sends the following Unicode Character. Please note: Some Windows applications require 4-digit decimal Code (e.g. Wordpad, Chrome), some other require 4-digit hexadecimal Code (e.g. Notepad++, Firefox)

You might as well need to change a Registry Setting on your Windows machine.

Debug mode

Displays information about the received character (ASCII code, USB keycode)

Client

TODO

Known issues/ Caveats

Keyboard Layouts

Due to the nature of the emulation on a USB keyboard layer, the list of available characters is determined by the keyboard layout on the target host.

Additionally only basic ASCII characters are transmitted correctly over the serial interface.

Thus an English keyboard layout is recommended for conventional usage. This is also configured by default in the Teensyduino development environment, but can be changed under "Tools" -> "Keyboard Layout".

To transmit other keys: