Open main menu

Difference between revisions of "Virtual Keyboard"

1,720 bytes added ,  18:54, 8 June 2009
Start to overhaul this page.
(Start to overhaul this page.)
Line 1: Line 1:
'''''WIP'''''
The ScummVM virtual keyboard hopes to provide a generalised implementation
of a virtual keyboard that will be usable on all backends that
require it.


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


== Introduction ==
The keyboard uses a 'queued events' model (so anything you type is queued and then passed back to the main event routine when the keyboard is closed) so it is best used for entering input rather then as part of the game input system (look towards the [[Keymapping_Improvements]] for systems for real time input).
 
This also means that the virtual keyboard (in it's default state) will ensure the engine is paused when it is active.


The virtual keyboard requires a valid 'keyboard pack' in order to operate. The
The virtual keyboard requires a valid 'keyboard pack' in order to operate. The
Line 23: Line 25:
for each mode at each resolution.
for each mode at each resolution.


== Features ==
== Key Features ==


* automatic resolution selection - with re-loading on change of resolution
* Automatic resolution selection - with re-loading on change of resolution


* preview display - to show the keys that have been pressed while keyboard is active
* 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  
* 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
* Special events - to submit or cancel the keyboard, switch mode, etc


* transparency support - using keycolor bitmaps  
* Transparency support - using keycolor bitmaps  


* fully draggable
* Draggable
 
== Special Events ==
 
In addition to the mapping of keys and the keyboard modes you can also wire up a number of special events to image map areas.
 
The current 'special events' are as follows.
 
* submit - Submit all the events queues (as shown in the display area) and close the keyboard.
<syntax type="xml">
<event name="name_of_image_map_rect" type="submit" />
</syntax>
* cancel - Close the keyboard and cancel all queued events.
<syntax type="xml">
<event name="name_of_image_map_rect" type="cancel" />
</syntax>
* clear - Clear all queued events.
<syntax type="xml">
<event name="name_of_image_map_rect" type="clear" />
</syntax>
* delete - Delete the last event from the queue (think backspace).
<syntax type="xml">
<event name="name_of_image_map_rect" type="delete" />
</syntax>
* move_left -
* move_right -


== Information for keyboard pack creators ==
== Information for keyboard pack creators ==


'''''TODO: start by explaining all the different types of buttons needed for the bitmaps'''''
'''NOTE:''' It should be noted that the ''wise'' keyboard pack author uses SVG for there keyboard image(s) and just saves bitmaps at whatever resolutions are needed. It also makes it easy to add extra resolution images later if needed.
 
In order to create a keyboard pack there are three main stages:
 
* Create the keyboard bitmaps.
* Construct the HTML image maps (use something like GIMP).
* Writing the XML configuration file and incorporate the image maps.


In order to create a keyboard pack there are two main stages: creating the bitmaps, and, writing the XML configuration file.
You can view the files that make up our default keyboard pack in SVN [http://scummvm.svn.sourceforge.net/viewvc/scummvm/scummvm/trunk/backends/vkeybd/packs/vkeybd_default/ here]. This should serve as a useful reference in conjunction with the information below.  


=== Keyboard bitmaps ===
=== Keyboard bitmaps ===
208

edits