Jörg Schulenburg

Whats about?

CW_KEY is a tiny program to control your linux computer with only few keys (1..3) using morse code.
 - want to edit files with closed eyes or in complete darkness? blind? 
 - riding bicycle (in a fitness room) and type text using morse key?
 - practice morse code by writing documents?
 - control your full automated home by just a few keys?
 - control your wearable computer or a real mini computer?
 - throw away a computer with partial defect keyboard?
 - your neighbour isn't happy about your speech recognition system?


Download cw_key.tgz , uncompress with

gunzip -c cw_key.tgz | tar -xf -

enter directory and start compilation:

cd cw_key


Getting started

You need "sh" to start try:

cw_key -3 -s

Startwith simple commands, like ls; cat >file.txt; mail friend@localhost; date; wget http://host/. There is still lot of work, to make the program useful for more complicated programs like pico, joe or lynx.


Start the program with sound switched on (-s) and try out the keys. You will hear what keys are used and which function they have. You can use speaker or soundcard (/dev/dsp) to generate sound. two and three key mode: key 1: . spelled as dit key 2: - spelled as daw key 3: , pause to seperate chars or make spaces (only three key mode) one key mode (works only in console mode): press shortly = dit press longer (three times short pulse) = daw pause three times of a short pulse = next char pause 5 times longer than a short pulse = space (or ASCII-SPC=0x20)

Morse code

The code itself:
 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  --.. 
 0  -----   1  .----   2  ..---   3  ...--   4  ....-
 5  .....   6  -....   7  --...   8  ---..   9  ----.

Non standart Morse codes:

 There are two ways to enter characters, which does not belong to the
 table above. First way is to use 7 or 8 bit ASCII codes and replace
 every 0-bit by a "dit" and a 1-bit by a "daw". The problem is to know
 about the ASCII code and binary numbers. The second way is to use modifier
 or combinations of chars. For this purpose four 4-bit Morse codes are
 replaced by modification codes. With SHIFT or ~ you can reach uppercase
 characters and with CTRL (Control or ^) you can reach special codes.
 In this way you are able to confirm unix comands or start a new line 
 using CTRL-M. For both possibilities you have an advantage if you know
 about ASCII codes. To handle special codes can be subject of changes
 in future versions.

Some examples of non standart Morse codes:

 RET=[SC] ...-.-.   DEL=[SB] ...-...
 SPC=[RH] .-.....   ESC=[UY] ..--.--    ASCII-7: 0=dit 1=daw

 In the three-key mode SPC or SPACE can be entered by pressing the
 pause key twice.

Short Form of code table:
  1\2     .   -  ..  .-  -.  -- ... ..- .-. .-- -.. -.- --. ---
  .   E   I   A   S   U   R   W   H   V   F   ~   L   @   P   J
  -   T   N   O   D   K   G   O   B   X   C   Y   Z   Q   &   ^

 The first column shows the first morse-bit, the upper row the
 other one to three morse bits. A "F" is coded as dit + dit daw dit
 in this table.  

ToDo / plans

 - switch off key-repeat (How to do that?)
 - expand morse code to full ASCII/UTF8 capability (ESC-sequenzes?)
 - start bash and pipe morse_input to it (fully PC control by CW)
   pipe+fork+execl("bash",NULL) .OR. popen("bash 2>cw","w") ???
 - output text to file
 - use DTR/CTS from serial port as In/Output (also 2..3 keys)
   how to deal with RS232 status wires using linux? need a kernel module?
 - use soundcard output or echo 07 (up to 3 times)
 - use IR as input with a RemoteTV (is that possible?)
 - make ----, ---., .-.-, ..-- redefinable via ESC sequences
 - small-code speech output of typed chars
 - show last error or errlog
 - F1 to switch on/off the help-screen (read, train-mode, etc.)
 - F2 switch on/off sound, reconfigure keys etc.
 - use /dev/beep?
 - use only keys '123' as input keys and bypass the rest?
 - use speaker-sound-module
 - write morse input (via RS232 ctrl-wires) module
 - cw-output module /dev/cw


  v0.2 - using mouse buttons
  v0.1 - initial version


   free for use, comments are welcome
 if you leave in raw-mode,
   press 2+F12+' (german-kbd) or 2+F12+= (us-kbd) for ^CX
 good idea is: alias X="kbd_mode -a"
 see also the cw- and cwcp-program
 raw-mode and speaker sound only works on linux console

  coding: F => ..-. => s0010 => 10010 => 0x12 => 18

  CW is the abbreviation for "Continuous Wave" or "Morse Code"
  The origin morse code was developed by Samuel F. B. Morse.
  The code was the earliest form of communication via radio and telegraph.

About this document

A good viewer to read this document is lynx, links or w3m.