1 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
4 <title>Xkbd - onscreen soft keyboard for X11</title>
5 <author><firstname>Matthew</firstname>
6 <surname>Allum</surname></author>
9 <holder>Matthew Allum <email>mallum@handhelds.org</email></holder>
13 <section><title>Introduction</title>
15 Xkbd is a small highly configurable 'virtual' on-screen keyboard for X11. It
16 is designed primarily for use on a PDA, but will hopefully be of use
17 on other devices where a physical keyboard is not present.
20 Xkbd uses no widget set and is based purely on xlib. It also
21 optionally uses the xft library for anti aliased fonts.
24 <section><title>Building and Installing xkbd</title>
26 Xkbd uses autoconf, so building it should be straightforward:
28 <prompt>$</prompt><userinput>./configure</userinput>
29 <prompt>$</prompt><userinput>make</userinput>
30 # This next step might require root access
31 <prompt>$</prompt><userinput>make install</userinput>
33 See the INSTALL file for (standard) gory details regarding autoconf.
36 Configure currently supports the following options;
39 <userinput>--enable-debug</userinput> <para> configure for a debug build </param>
42 <userinput>--enable-xft</userinput> <para>configure to use XFT library for anti-aliased fonts.</para>
47 Make also has an 'ipkg' target for building shiny ipkgs.
50 A prebuilt ipkg is included in the familiar linux distributions
54 <section><title>Using Xkbd</title>
56 On launch xkbd will attempt to open its configuration file from
59 xkbd understands the following command switches;
61 <ListItem><formalpara> -display <display></formalpara>
62 Selects the display for xkbd to appear on.
64 <ListItem><formalpara> -geometry <geometry></formalpara>
66 Provide xkbd with a position and dimension parameters.
67 For example 320x100+50+50 will make a 320x100 pixel keyboard 50
68 pixels from the side and top of your display.
70 NOTE: Its useful to use this option in overide redirect mode
71 ( see below ) as xkbd by default will alway take up the smallest
72 space possible for its current configuration, unless told
73 differently by this option or the window manager.
75 <ListItem><formalpara> -fa <font name>[-<point size> ]</formalpara>
77 Select the xft AA font for xkbd. Overrides whatever was defined
80 <ListItem><formalpara> -fn <font name></formalpara>
82 Select the X11 font for xkbd. Like -fa also overrides.
84 <ListItem><formalpara> -k <config file></formalpara>
86 Select an alternate keyboard definition file other than the
89 <ListItem><formalpara> -v </formalpara>
93 <ListItem><formalpara> -h </formalpara>
95 Display a breif help message.
99 <section><title>Configuring Xkbd</title>
101 The actual 'keyboard' xkbd uses is defined in a configuration
102 file. The defualt config file is /etc/xkbdrc, an alternate can be
103 specified with the -k switch on startup.
106 A configuration file for xkbd is split into 'tagged' sections;
107 A global section mainly for the keyboards overall appearance , And
108 row sections containing key definitions which defined the actual
110 See /etc/xkbdrc for an example.
113 The <global> section should appear first in the file and can contain
114 the following key/value pairs ( seperated by a space ) ;
118 <title>xkbd config file options</title>
119 <tgroup cols=3 align="char" charoff="50" char=".">
124 <entry>Description</entry>
129 <entry>render</entry>
130 <entry>xft|normal</entry>
131 <entry>Set mode to 'xft' if you want to use anti aliased fonts.</entry>
135 <entry>font definition</entry>
137 Defines the font used for the keyboard. For an xft font, specify
138 the point size like <font name>-<size>. Default font is fixed / mono.
143 <entry>color def</entry>
145 Defines the color of keyboard background. Defaults to white.
146 This as with all color definitions can be either an RGB colon
147 seperated list of an X color name. Defaults to white.
151 <entry>down_col</entry>
154 Defines the color of a held down active key. Defaults to black.
162 Defines the color of the keyboard key text. Defaults to black.
171 Defines the color of the keys border. Defaults to black.
177 <entry>pixel count</entry>
179 Defines the keyboards width or height in pixels. Is overridden by
180 the -geometry switch. Defaults to the smallest possible size for
181 the defined keyboard.
186 button_style </entry>
187 <entry>rounded|plain|square</entry>
189 Sets the basic button visual 'style. Can be rounded ( default ),
195 After the <global></global> definition, there then follows one of more
196 <row> sections which contain the definitions for each on that row. The
197 Rows go from top to and bottom and the keys left to right. Each row
198 should just contain <key> definitions, there are no key / value definitions
202 Each key has 3 'states', a default state, a shifted state and a modded
203 state. Each state contains different key text and keysyms ( what is
204 actually sent to the focused window when a key is pressed )
207 Each <key> section can contain the following key / value pairs.
211 Defines the text which is displayed on a key when shift or a
212 modifier ( ie alt ) is not pressed.
216 Defines the actual keysym value that is sent by xkbd to the
217 active window when the key is pressed. The keysym is the actual
218 value thats sent to to active window. Keysyms are listed in
219 /usr/X11R6/include/X11/keysymdef.h
220 The is a special keysym '!Mod' which specifies the button is a
221 'special' modifier button to access a 2nd alternate keysym for
222 the key - see the mod section below.
226 Defines the text which is diplayed on a key when a shift or CAPS
227 key is held down. If not set the key will show the default text
228 when shift is pressed.
232 Defines the keysym sent when shift or caps is held down.
236 Defines a second alternative text string to be displayed. The mod option
237 exists to make it easy to define smaller keyboards with more
242 The keysym to be sent when the 'mod' button is pressed.
244 img <full path to image>
246 Defines an xpm to be displayed on a key. With this set, no text
247 will be displayed and the img currently is the same across of
252 Defines the background color of a key, overiding what was set in
257 Defines the foreground color ( ie text ) of a key, overiding what
258 was set in <global> .
260 slide_up_ks <XKeysym>
262 Defines the keysym to be sent when a key is pressed, but the
263 pointer is slid up before being released ( a 'slide' ). Other
264 slide directions can also be defined ( see below ). defaults
265 to the shifted keysym
267 slide_down_ks <XKeysym>
269 defaults to sending a CTRL with the keysym
271 slide_left_ks <XKeysym>
275 slide_right_ks <XKeysym>
281 Forces the minimum width of a key to be this set value in pixels.
282 Useful specifying a more exact layout.
286 Forces the minimum height of a key to be this set value in
289 NOTE: If a key contains no keysym definitions its assumed to be an
293 <section><title>FAQ</title>
296 <section><title>Xkbd runs ok, but dont send key presses !</title>
298 There could be one of two things causing this;
301 <userinput>xmodmap </userinput>
304 <section><title>How do I get xkbd to launch from the dock </title>
306 monolaunch provides this. Run monolaunch like this;
308 <userinput>monolaunch /usr/share/xkbd/img/kbd.xpm xkbd</userinput>
309 <para> Adding the '-k' switch to monolaunch will cause xkbd to completely disappear rather than minimise to a bar.
314 <section><title>Embedding Xkbd in to other apps</title>
319 <section><title>License</title>
321 Xkbd is free software released under the terms of the GNU General
322 Public License, (GPL). You can redistribute it and/or modify
323 it under the terms of the GNU General Public License as published by
324 the Free Software Foundation; either version 2, or (at your option)
328 Xkbd is distributed in the hope that it will be useful,
329 but WITHOUT ANY WARRANTY; without even the implied warranty of
330 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
331 GNU General Public License for more details.
334 <section><title>Credits</title>
335 <para>Xkbd is written by Matthew Allum. It uses the libvirtkeys lib by.
338 Be sure to check out other exciting software by me including; xkbd - a
339 xlib virtual on-screen keyboard, pikpak - a python gtk front end to
340 ipkg, gtksolo - a gtk module which turns held down left clicks into
341 right clicks on gtk apps and jabberpy - a Python library for the Jabber
342 instant messaging protocol.
344 Xkbd is copyright Matthew Allum 2002.