Virtual Keyboard

From ScummVM :: Wiki
Revision as of 15:09, 15 October 2008 by Kenny-d (talk | contribs) (New page: The new ScummVM virtual keyboard hopes to provide a generalised implementation of a virtual keyboard that will be usable on all of the small backends that require it. === Introduction ==...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The new ScummVM virtual keyboard hopes to provide a generalised implementation of a virtual keyboard that will be usable on all of the small backends that require it.

Introduction

The virtual keyboard requires a valid 'keyboard pack' in order to operate. The pack should consist of an XML configuration file and a collection of 24-bit bitmaps. It can come in the form of a compressed zip file or a directory.

In order to make pack creation quick and easy, the virtual keyboard display uses complete bitmap images. To go with each bitmap a HTML-style image map must be created that defines the clickable regions of the image. The primary purpose of the XML configuration file is to contain the image map definitions along with associated event definitions and additional data.

As it is impractical to display all possible keys at the same time, the virtual keyboard has the ability to switch to different modes when special keys are pressed. Also, the virtual keyboard has to work at a range of different resolutions. Therefore, the pack must provide a bitmap and configuration data for each mode at each resolution.

Features

  • automatic resolution selection - with re-loading on change of resolution
  • preview display - to show the keys that have been pressed while keyboard is active
  • modifier keys - allow shift, control, and alt to be added to keystroke without using a separate mode
  • special key events - to submit or cancel the keyboard, switch mode, etc
  • transparency support - using keycolor bitmaps
  • fully draggable

Creating a keyboard pack

In order to create a keyboard pack there are two main stages: creating the bitmaps, and, writing the XML configuration file.

Keyboard bitmaps

XML configuration file

Inclusion in build

By default the virtual keyboard is disabled from a ScummVM build. In order to enable it use the --enable-vkeybd flag when running configure.

Using the keyboard

defining keyboard pack path / name of keyboard

in game: pauses system preview area