Emulator Skin XML Schema

The following code example shows the XML schema for the .xml file. For more information about the .xml file, see Emulator Skin Files.

<?xml version="1.0" encoding="ISO-8859-1"?>

<skin>
  <view
    titleBar ="My Emulator skin"

    displayPosX="10"
    displayPosY="149"

    displayWidth="272"
    displayHeight="224"

    displayDepth="8"

    mappingImage="map.bmp"
    normalImage="up.bmp"
    downImage="down.bmp"
  >

    <button
      
      toolTip="This is my ToolTip."
      onClick="  DOWN:Key_LeftShift
                 Key_Z
                 0x00000015
                 UP: Key_LeftShift
                 Key_A"
      onPressAndHold="Key_B"
      mappingColor="0x00FF00"

    />

  </view>
</skin>

In this example, the <?xml version="1.0" encoding="ISO-8859-1"?> text encoding specifier defines which script the parser passes to the engine for an Emulator skin. For Japanese, you may replace ISO-8859-1 with Shift-JIS.

The <skin> tag encapsulates the schema for an Emulator skin. You can use only one <skin> tag in each .xml file.

The <view> tag contains the schema for an Emulator skin. You can use only one <view> tag per <skin> tag.

The titleBar ="My Emulator skin" title bar element specifies the title of the window for the Emulator.

The displayPosX="10" and displayPosY="149" elements specify the position to locate the window containing the display for the Emulator within the window for the Emulator skin. You may choose coordinates that are off screen to make the display not visible.

The displayWidth="272" and displayHeight="224" elements specify the width and height of the display for the Emulator. For width, choose an integer between 80 and 1024 that is divisible by 8. For height, choose an integer between 64 and 768.

The displayDepth="8" element specifies the color depth of the display for the Emulator. For color depth, choose 8, 16 or 32.

The normalImage="up.bmp" element specifies the normal art file for the Emulator skin. The normal art file is required for the Emulator skin. The normal art file specifies the size of the window for the Emulator and the appearance of the Emulator skin.

The mappingImage="map.bmp" element specifies the mapping file for the Emulator skin. The mapping file is an optional file that defines the regions occupied by the buttons in the Emulator skin.

The downImage="down.bmp" element specifies the down art file for the Emulator skin. The down art file is an optional file that specifies the appearance of the buttons on the Emulator skin when the buttons are pressed. For more information about art and mapping files, see Emulator Skin Files.

The <button> tag contains the description of a button on the Emulator skin.

The mappingColor="0x00FF00" element specifies the RGB color in the mapping file to use for the button. All pixels having this color in the mapping image represent the area in the Emulator skin that you can click for this button. This area behaves as a mask through which the down art file is displayed when you press the button.

The toolTip="This is my ToolTip." element is an optional element whose text displays when you move the pointer over the button.

The following element is optional. It specifies the keyboard key presses that the keyboard driver passes to the engine for the Emulator skin when you press the button. You can specify a key code from the table later in this topic, or you can specify a hexadecimal or integer value corresponding to a raw keyboard scan code. For more information about raw keyboard scan codes, see the specifications for your keyboard.

onClick="       DOWN:Key_LeftShift
                        Key_Z
                        0x00000015
                        UP: Key_LeftShift
                        Key_A"

The onPressAndHold="Key_B" element allows you to specify keyboard events to repeat while a button on the Emulator skin is being pressed. This feature supports all key codes except for the SHUTDOWN key code.

The Emulator provides key codes corresponding to the action of pressing certain keys on the keyboard. You can use these key codes to define behavior for the Emulator skin in the .xml file for the Emulator skin. The following table shows key codes for keyboard keys recognized by the Emulator.

Keyboard area Key codes
Top row Key_Escape

Key_F1

Key_F2

Key_F3

Key_F4

Key_F5

Key_F6

Key_F7

Key_F8

Key_F9

Key_F10

Key_F11

Key_F12

Numbers row Key_LeftApostrophe

Key_1

Key_2

Key_3

Key_4

Key_5

Key_6

Key_7

Key_8

Key_9

Key_0

Key_Hyphen

Key_Equals

Key_Backspace

Key_Insert

Key_Home

Key_PageUp

Key_NumLock

KeyPad_Divide

KeyPad_Multiply

KeyPad_Minus

QWERTY row Key_Tab

Key_Q

Key_W

Key_E

Key_R

Key_T

Key_Y

Key_U

Key_I

Key_O

Key_P

Key_LeftBracket

Key_RightBracket

Key_Backslash

Key_Delete

Key_End

Key_PageDown

KeyPad_7

KeyPad_8

KeyPad_9

KeyPad_Plus

ASDF row Key_A

Key_S

Key_D

Key_F

Key_G

Key_H

Key_J

Key_K

Key_L

Key_SemiColon

Key_SingleQuote

Key_Enter

KeyPad_4

KeyPad_5

KeyPad_6

ZXCV row Key_LeftShift

Key_Z

Key_X

Key_C

Key_V

Key_B

Key_N

Key_M

Key_Comma

Key_Period

Key_Slash

Key_RightShift

Key_Up

KeyPad_1

KeyPad_2

KeyPad_3

KeyPad_Enter

Modifiers row Key_LeftCtrl

Key_LeftWindows

Key_LeftAlt

Key_Space

Key_RightAlt

Key_RightWindows

Key_Application

Key_RightCtrl

Key_Left

Key_Down

Key_Right

KeyPad_0

KeyPad_DecimalPoint

The Emulator also provides the following three special key codes:

  • DOWN:
  • UP:
  • SHUTDOWN

The DOWN: key code provides the effect of keeping pressed in the keyboard key corresponding to the key code that follows the DOWN: key code. The UP: key code provides the effect of releasing the keyboard key corresponding to the key code that follows the UP: key code.

The following code example shows how to generate an uppercase A character using the DOWN: and UP: key codes.

OnClick="DOWN: Key_LeftShift Key_A UP: Key_LeftShift"

The SHUTDOWN key code displays a dialog box where the user can choose to shut down the Emulator.

See Also

Customizing a Skin for the Emulator

 Last updated on Friday, October 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.