diff --git a/backends/common/virtual-keyboard-parser.cpp b/backends/common/virtual-keyboard-parser.cpp
index 8e788f53d4f..7b1e79e937c 100644
--- a/backends/common/virtual-keyboard-parser.cpp
+++ b/backends/common/virtual-keyboard-parser.cpp
@@ -260,6 +260,9 @@ bool VirtualKeyboardParser::parserCallback_Event() {
evt.type = VirtualKeyboard::kEventSwitchMode;
evt.data = new Common::String(evtNode->values["mode"]);
+ } else if (type == "close") {
+ evt.type = VirtualKeyboard::kEventClose;
+ evt.data = 0;
} else
return parserError("Event type '%s' not known", type.c_str());
diff --git a/backends/common/virtual-keyboard-parser.h b/backends/common/virtual-keyboard-parser.h
index 69ca0a99a63..cd2ea28faf3 100644
--- a/backends/common/virtual-keyboard-parser.h
+++ b/backends/common/virtual-keyboard-parser.h
@@ -29,6 +29,138 @@
#include "common/xmlparser.h"
#include "backends/common/virtual-keyboard.h"
+/**
+ TODO - information about optional attributes and their default values
+
+
+ ***************************************
+ ** Virtual Keyboard Pack File Format **
+ ***************************************
+
+The new virtual keyboard for ScummVM is implemented in the same way as a HTML
+ImageMap. It uses a single bitmap of the entire keyboard layout and then a
+image map description allows certain areas of the bitmap to be given special
+actions. Most of these actions will be a virtual key press event, but there
+will also be special keys that will change the keyboard layout or close the
+keyboard. The HTML image map description is contained in a larger XML file that
+can describe all the different modes of the keyboard, and also different
+keyboard layouts for different screen resolutions.
+
+ ********************************************
+ ** Example keyboard pack description file **
+ ********************************************
+
+
+
+
+
+
+
+ ...
+
+
+
+
+ ...
+
+
+
+
+
+
+
+
+
+
+ ...
+
+
+
+*************************
+** Description of tags **
+*************************
+
+
+
+This is the required, root element of the file format.
+
+attributes:
+ - modes: lists all the modes that the keyboard pack contains
+ - initial_mode: which mode the keyboard should show initially
+ - v_align/h_align: where on the screen should the keyboard appear initially
+
+child tags:
+ - mode
+
+-------------------------------------------------------------------------------
+
+
+
+This tag encapsulates a single mode of the keyboard. Within are a number of
+layouts, which provide the specific implementation at different resolutions.
+
+attributes:
+ - name: the name of the mode
+ - resolutions: list of the different layout resolutions
+
+child tags:
+ - layout
+ - event
+
+-------------------------------------------------------------------------------
+
+
+
+These tags describe a particular event that will be triggered by a mouse click
+on a particular area. The target attribute of each image map area should be the
+same as an event's name.
+
+attributes:
+ - name: name of the event
+ - type: what sort of event is it (key | switch_mode | close)
+ - for key events
+ - code / ascii / modifiers: describe a key press in ScummVM KeyState format
+ - for switch_mode events
+ - mode: the mode that should be switched to
+
+-------------------------------------------------------------------------------
+
+
+
+These tags encapsulate an implementation of a mode at a particular resolution.
+
+attributes:
+ - resolution: the screen resolution that this layout is designed for
+ - bitmap: filename of the 24-bit bitmap that will be used for this layout
+ - transparent_color: color in r,b,g format that will be used for keycolor
+ transparency.
+
+child nodes:
+ - map: this describes the image map using the same format as html image maps
+
+-------------------------------------------------------------------------------
+
+