General information about the program

The program has been written in C++ (of course) with the help of KDevelop and QT Designer. The programming interface (API) is very similar to the API used in the QT and KDE libs, so it shouldn't be difficult to understand the source code.

The source tarballs available in the download section contain the KDevelop projects. So if everything else works you can just download such a file, fire up KDevelop and start coding right away. Of course there are numerous other ways to contribute to the project (which would be much appreciated).

 Contributing to KTouch

There are several ways to help us improve KTouch. You could

  • write lectures/training files or improve the existing ones (see section "Lectures/Training files" below)
  • code patches or join the project permanently as developer
  • create new keyboard layouts
  • draw some nice icons/images for the toolbars and the preferences dialog
  • write and keep the program documentation up-to-date
  • do anything else you think that could be beneficial to the project

You are more then welcome to contribute to this (in my humble opinion) GREAT program :-)

 Writing lectures/training files

Training files are simple text files, so if you want you can edit them yourself in the build-in lecture editor (or in any text editor). If you need some raw data, you can use Haavards training file generators to create the lectures and then modify them lateron.

Some notes about training lectures
Every level should introduce 2 (or at most 3) new keys. The first few lines should just use these new keys and then in the following lines the new keys should be mixed with previously introduced keys. The complexity should increase and (if possible) words of the choosen language should be used. So at least after level 8..9 it should be possible to offer the user small (and preferably typical) phrases to practise. For instance, the first four lectures introduce the 8 basis keys. Then e and i are added (in english lectures). Now it is already possible to ask for phrases like "kai lied all lisa did I did" or probably more sensible stuff like this. Anyway, the process of normal mixed letters to practice the layout like "aj sk lkde aijkl jdsls" should be mixed with normal words.

The training file generators
Haavard wrote a number of small programs which can extract the content of an ASPELL dictionary and create lecture file from them. Take a look at the following files:
PERL version of the generator
C version of the generator

 Source code contributions/Patches

If you want to fix a bug, implement a feature or just contribute and source code change you like to the program, feel free to send me (Andreas) a patch, so that I can include it into the official SVN source code.

The easiest way to do that is to get a local copy of the source code on SVN (see download section). If you already have the source code, make sure you work with an up-to-date version, using

   svn update

inside the kdeedu/ktouch directory.

Now let's assume you fix a bug and modify the files


After your changes are complete and tested, type

    svn status

in the kdeedu/ktouch directory. You will get an output like:

    ?      KTouch.kdevelop.filelist
    ?      Doxyfile
    ?      KTouch.kdevelop.pcs
    ?      KTouch.kdevses
    ?      KTouch.kdevelop
    ?      src/ktouchstatuslayout.cpp
    ?      src/ktouchprefgenerallayout.h
    ?      src/ktouchlectureeditor_dlg.cpp
    ?      src/ktouchkeyboardeditor.moc
    ?      src/ktouchprefkeyboardlayout.moc
    ?      src/ktouchprefkeyboardlayout.h
    ?      src/ktouchstatistics_dlg.cpp
    ?      src/ktouchpreftraininglayout.moc
    ?      src/ktouchslideline.moc
    ?      src/.kdbgrc.ktouch
    M      src/ktouch.h
    M      src/ktouch.cpp
    ?      training/text.ktouch.xml

Unless you added files yourself, ignore the lines with ? in front (these are temporary files). Note the lines with an M in front of the file names. These lines show you the files that you modified. Now type

    svn diff -u ktouch.h ktouch.cpp > my_patch.patch

After the -u add all files you have modified and then a > and afterwards the file name of your patch file. Send the patch file to me (preferably gzipped together with some ChangeLog info) and I'll check and apply the patch to the SVN source code.

 Writing keyboard layouts

The current keyboard layouts are plain text files. Just pick one (that is close to the keyboard you want to create), create a copy (unsing the country language id as suffix) and modify it. The numbers correspond to the UNICODE key codes.

The current keyboard system is somewhat limited and not all keyboard layouts can be created with this system. So, for instance, only one key character can be displayed per key. As an example I've added some keyboard layouts to this page which are somewhat uncommon and show how different keyboards can look like:






As a consequence we have to redesign the keyboard drawing engine a bit. For one thing, drawing of a key will be independent of the actual character that has to be pressed in order to activate a key. Essentially for each key some geometric and access information have to be stored. Right now I can think of something like the following structure:

  1. Key information:
    • Key identification number
    • Geometry type: rectangular, polygon
    • Coordinates: x1, y1, x2, y2, ...
      (for the rectangular keys x1, y1 are the upper left corner of the key, x2, y2 are the lower right)
    • Character (unicode number) to be drawn at the top left
    • Character (unicode number) to be drawn at the top right
    • Character (unicode number) to be drawn at the bottom left
    • Character (unicode number) to be drawn at the bottom right
    • Primary key (number 0 = top left ... 3 = bottom right, indicates which character is the primary character and is printed slightly bigger then the others)
    • Decorative key (flag, if set this key has some special symbol or text printed on)
    • Decoration type (TAB, SHIFT, CAPS_LOCK, ESC, NUM, STRG, ALT, TEXT)
    • Decorative text (only used then Decoration type is TEXT)
  2. Access information (stored for every character):
    • List of key identification numbers (these are all the keys that need to be pressed)
    • Finger key identification number (code of key where finger rests before pressing the key/character)

 Designing icons and graphics

Any contribution of nice looking icons and graphics are highly appreciated. If you can draw an icon that looks better than the current icons, please send it per mail and we'll add it as soon as possible.

General program info
Lectures/training files
Keyboard layouts
Graphics and icons
Contact & Links
Valid HTML 4.01!