[ Home > xvkbd ]

xvkbd - virtual keyboard for X window system

[ English | Japanese ]

xvkbd is a virtual (graphical) keyboard program for X Window System which provides facility to enter characters onto other clients (softwares) by clicking on a keyboard displayed on the screen. This may be used for systems without a hardware keyboard such as kiosk terminals or handheld devices. This program also has facility to send characters specified as the command line option to another client.

Screenshot of xvkbd

The default configuration may be too large for systems with small screen, but it can be configured to use smaller space (240x120 pixels, for example).

Screenshot of xvkbd

The standard keyboard layout is based on the traditional US layout, but it can be configured to use the different layout, such as German layout.

GTKeyboard provides similar facility and it is more powerful than xvkbd, with its built-in text editor and some other facilities.



Environment

xvkbd will work on X11R5 or X11R6. It is tested on redhat Linux and Solaris, and it will work also on most UNIX-like systems.

This program uses Xaw (use of Xaw3d is recommended) and no special library is required.


Download

xvkbd is distributed under terms of GPL.


Install

  1. untar the source in a directory, and move to the directory

  2. If you wish to use genuine Xaw insead of Xaw3d, edit Imakefile and remove (or comment-out) `#define XAW3D'.

  3. Run xmkmf; make install


Operation

Input Keys

When xvkbd is started, the image of a keyboard will be displayed on the screen. Clicking any key on the xvkbd window will send the character to the focused window as if the key had been actually typed with the hardware keyboard.

If you want to input upper-case alphabets or other characters on the upper position on the keyboard, you should click the key after selecting Shift by clicking it, or click the key with mouse button 3 (maybe right button) or mouse button 4. In the similar manner, if you want to input Controled characters, you should click the key after clicking Control, or click the key with mouse button 2 (maybe middle button). Alt and Meta can be used in the similar manner with Control, but there are no shortcuts with mouse buttons.

Setting Input Focus

If you are using a window manager and clients where you can set input focus by clicking mouse button on the window (and you don't have to keep pointer in the window after that), you can simply set input focus in the normal way and then click keys on the xvkbd window - the character will be sent to the selected posision.

If you are using a window manager or clients where you must keep the pointer in the input field to input from the keyboard, or if the input focus is switched to the xvkbd window when you clicked on the key on the xvkbd window, you must make xvkbd to set input focus explicitly by clicking the Focus button on the xvkbd window and then click on the input field. This input focus can be cleared by clicking Focus button with mouse button 3.

Options

xvkbd accept following command line options, in addition to general options such as -display.

-geometry
Set window geometry. This can be set by xvkbd.windowGeometry resource (note that it is not xvkbd.geometry), too.

When you are attempting to set window position with the distance from right/bottom of the screen, please note that you must take account of size of the window border. (If you specify -geometry -0-0, the window will not fit in the screen.)

-no-repeat
Do not auto-repeat even if key is depressed long time.
Resource xvkbd.autoRepeat: false has same function.

If auto-repeat is enabled (this is the default), time before start auto-repeat can be set as xvkbd*Repeater.initialDelay: 600, and period of repeat can be set as xvkbd*Repeater.minimumDelay: 100 (unit of there parameters are milli-seconds).

-no-functionkey
Do not display function keys.
Resource xvkbd.functionkey: false has same function.

-no-keypad
Do not display keypad.
Resource xvkbd.keypad: false has same function.

-compact
Do not display function keys nor keypad.
Resource xvkbd.compact: true has same function.

-keypad
Display only keypad. This option will be ignored if -no-keypad or -compact is specified.
Resource xvkbd.keypadOnly: true has same function.

-text string
Send the string to the focused window (see also -window option).
If this option is specified, xvkbd will not open its window and terminate soon after sending the string.

The string can contain:

Please note that modify with ``\S'' will be ignored in many cases. For example, ``a\Cb\ScD\CE'' will be interpreted as a, Control-b, c, Shift-D, and Control-Shift-E.

-window window
Specify the ID (hexadecimal value leaded with 0x, or decimal value) or name (instance name or class name) of the window to set input focus. If this is not specified, xvkbd will use input focus under control of the window manager, unless focus is specified explicitly via Focus button. Even if this option is specified, you can set input focus to other windows using Focus button, or clear the input focus.
If there are two or more windows which have the name specified with this option, the window which was found first will be selected.

-widget widget-name
Specify the name of the widget to set the input focus. To use this feature, the client must support Editres protocol. In general, this option will be used with -window option.
If you want to set input focus to the widget foo.bar.zot, you can write zot, bar.zot or foo.bar.zot as widget-name. To avoid confusion, the widget-name should match with a single widget of the client.

For example,

xvkbd -window xarchie -widget searchText -text "\Ca\Ckabc\r"
will enter the string ``abc'' to the ``Search Term'' field of a xarchie window.

-kterm
If this option is specified, xvkbd will switch input focus to the last child if the window got new children after input focus had been set. Probably, this is only useful when complex input method (such as kinput2 for Japanese) is activated in the terminal window (such as kterm).
Resource xvkbd.kterm: true has same function.

-true-keypad
If this option is specified, xvkbd will attempt to use keysyms such as XK_KP_1 instead of XK_1.
Resource xvkbd.keypadKeysym: true has same function.


Customization

How to Customize xvkbd

Some degree of customization of xvkbd is possible by setting resources. Some resources are already described above, and resources to customizing keyboard layout are described below.

To set resources, you can:

  1. put them in your $HOME/.Xdfaults file, or
  2. load them via xrdb(1), or
  3. set the filename to the $XENVIRONMENT environment variable, or
  4. put them in application default directory as XVkbd-suffix and set resource ``xvkbd.customization: -suffix'', or
  5. put them in application default directory as XVkbd.

Here, application default directory can be either of:

When the application default file is to be stored in the system's application default directory, the file must contain ``#include "XVkbd-common"'' near top of the file.

xvkbd is distributed with some sample application default files, and they will be installed in the system's application default directory.

Making Window Small

Size (and position) of xvkbd window can be set by xvkbd.windowGeometry resource. When making window small, you may need to choose the smaller font, too.
  xvkbd.windowGeometry: 240x120
  xvkbd.compact: true
  xvkbd*Font: 6x12

Removing Unwanted Keys

Keys on xvkbd window can be removed by setting its width to 1.

To remove Compose key and make Shift key larger, you can write:

  xvkbd*Multi_key.width: 1
  xvkbd*Shift_R.width: 75

To remove right Alt and Meta key, you can write:

  xvkbd*Alt_R.width: 1
  xvkbd*Meta_R.width: 1

Customizing Keyboard Layout

Layout of keys on the xvkbd window can be customized with following resources:
xvkbd.NormalKeys
list of keys available when neighter of Shift and AltGr are not selected
xvkbd.ShiftKeys
list of keys available when Shift key is selected
xvkbd.AltgrKeys
list of keys available when AltGr key is selected
xvkbd.ShiftAltgrKeys
list of keys available when both AltGr and Shift are selected
xvkbd.KeyLabels
list of labels displayed on the keys

In those resources, each keys are separated by spaces, and rows of keys are terminated with ` \n\' (note that `\n' must have space before it).

For example, following are resources for German layout (see screen shot), extracted from XVkbd-german.ad in the xvkbd distribution:

  xvkbd.NormalKeys: \
    F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 BackSpace \n\
    Escape 1 2 3 4 5 6 7 8 9 0 ? ` ^ # \n\
    Tab q w e r t z u i o p \374 + Delete \n\
    Control_L a s d f g h j k l \366 \344 Return \n\
    Shift_L < y x c v b n m , . - Multi_key Shift_R \n\
    Caps_Lock Alt_L Meta_L space Mode_switch Left Right Up Down

  xvkbd.ShiftKeys: \
    F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 BackSpace \n\
    Escape ! " \247 $ % & / ( ) = \337 ' \260 | \n\
    Tab Q W E R T Z U I O P \334 * Delete \n\
    Control_L A S D F G H J K L \326 \304 Return \n\
    Shift_L > Y X C V B N M ; : _ Multi_key Shift_R \n\
    Caps_Lock Alt_L Meta_L space Mode_switch Left Right Up Down

  xvkbd.AltgrKeys: \
    F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 BackSpace \n\
    Escape \271 \262 \263 \243 \254 \251 { [ ] } \\ ' ^ ' \n\
    Tab @ w e r t z u i o p \374 ~ Delete \n\
    Control_L a s d f g h j k l \366 \344 Return \n\
    Shift_L | y x c v b n \265 , . - Multi_key Shift_R \n\
    Caps_Lock Alt_L Meta_L space Mode_switch Left Right Up Down

  xvkbd.KeyLabels: \
    F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Backspace \n\
    Esc !\n1\271 "\n2\262 \247\n3\263 $\n4\243 %\n5\254 &\n6\251 \
    /\n7{ (\n8[ )\n9] =\n0} \337\n\?\\ '\n` \260\n^ |\n# \n\
    Tab Q@ W E R T Z U I O P \334 *\n+~ Del \n\
    Control A S D F G H J K L \326 \304 Return \n\
    Shift >\n<| Y X C V B N M\265 ;\n, :\n. _\n- Com\npose Shift \n\
    Caps\nLock Alt Meta space AltGr left right up down

xvkbd also contains XVkbd-latin1.ad which carries most Latin-1 characters (see screen shot).

XVkbd-german and XVkbd-latin1 will be installed in the system's application default directory, and setting the resource ``xvkbd.customization: -german'' will make xvkbd to use the German layout. For another method to activate those settings, please refer How to Customized xvkbd above.


Miscellaneous Informations

Notes

Limitations Depends to the Clients

Some clients (applications) will not accept input from xvkbd.

xterm (kterm)
To use with xterm or kterm, you must set xterm.allowSendEvents resource (kterm.allowSendEvents in kterm) to true, or switch Allos SendEvents to ON via Main Options menu.

XView-based clients
Normally, XView-based clients (such as DeskSet tools in OpenWindows) will not accept input from xvkbd. You may avoid this restriction by invoking those clients with -WS (or -defeateventsecurity) option, like ``cmdtool -WS''.

Other Clients
There may be other clients which will not work with xvkbd. The main cause is the client can be coded so that it will ignore events from other clients.

Change Log

Version 0.1 (2000-05-13)

Version 0.2 (2000-09-15)

Version 0.3 (2000-10-05)

Version 1.0 (2000-11-03)

Feedback

Please send feedback (such as bug reports, requests or comments) to Tom Sato <VEF00200@nifty.ne.jp>.

The latest version of this software and more information about it may be available at http://member.nifty.ne.jp/tsato/xvkbd/.


by Tom Sato, 2000-11-03