-
Notifications
You must be signed in to change notification settings - Fork 0
Python Guide
This page documents the Python scripts found in the scripts directory. These scripts are the primary way of configuring and interacting with the SuperKey hardware. A standalone library (superkey) is provided, which acts as a wrapper for SuperKey's serial interface. The scripts directory also contains several handy standalone scripts:
-
autokey.pyallows controlling the keyer directly with your keyboard. -
example.pyshows a demonstration of using thesuperkeylibrary, as well as demonstrating some of SuperKey's hardware features. -
interactive.pycreates an "interactive" environment for interfacing with SuperKey with a console-like REPL experience.
The superkey library and the standalone scripts have no dependencies other than the built-in Python standard library. A future improvement is to improve the packaging for this library, to make it more consumable by other Python projects.
The autokey.py script provides a convenient interface for using the keyer's autokey mode. The following command line
arguments are supported:
-
--port- Serial port name. -
--baudrate- Serial port baud rate. (This should always be 19200.) -
--timeout- Serial port timeout, in seconds. -
--immediate- Activate "immediate" mode. -
--silent- If specified, input will not be echoed back to the console (only applicable to immediate mode).
There are two modes of operation, as discussed below.
Immediate mode is activated by invoking the script with theThe autokey.py script accepts user input from the keyboard, and immediately forwards it on to the keyer to be keyed.
Any key press which is not a valid Morse code character is ignored. The following special key presses are supported:
- Backspace - Immediately stops keying any string which was previously entered. This can be used to "cancel" input.
- Escape - Exits the tool.
The following notes should be observed in immediate mode:
- Characters are queued for transmission as they are typed.
- Newlines may be typed to help separate messages, but are ignored by the keyer.
- Prosigns may be entered by preceding the characters with a backslash.
- (e.g., entering
\arwill result in the prosign· — · — ·being keyed).
- (e.g., entering
- Prosigns with between 2 and 9 characters are supported by immediately following the backslash with a digit.
- (e.g., entering
\3soswill result in the prosign· · · — — — · · ·being keyed).
- (e.g., entering