User Tools

Site Tools


key

Key

The key simulates a key on a keyboard by dispatching a keyboard event, containing the assigned character and key unicode values, when touched.

Two differently customized key elements.
Key screenshot

Characteristic

Definition
Type Interactive Display Object
Category Element
Scope Local
Position *
Parents Container
Children none
Gestures none
Requirements none

Attribute

Type

Description
capsOn true/false a flag indicating the “capitalized” state of the text
charCode number sets the character code (unicode) value of the key
downTextColor number the color of the text when touched down
icon object reference the icon displayed on the key element
initTextColor number the initial text color
keyCode number the key code (unicode) value of the key
outTextColor number the text color when touched out
overTextColor number the text color when touched over
shiftCharCode number the character code (unicode) value of the key pressed while in a shift state
shiftOn true/false the text displayed on the key while in a shift state
text object reference the text displayed on the key
upTextColor number the text color when touched up

See Also: Display Attributes

<Key id="ke" x="900" y="255" scale="4" initial="customInit" down="customDown" text="letter" downTextColor="0xFF0000" overTextColor="0x00FF00">
    <Graphic id="customInit" width="45" height="45" shape="rectangle" color="0xFF0000"/>	
    <Graphic id="customDown" width="45" height="45" shape="rectangle" color="0xFFFFFF"/>
    <Text id="letter" text="C" fontSize="40" textColor="0xFFFFFF" autoSize="left" selectable="false" x="3" y="-10"/>	
</Key>
key.txt · Last modified: 2015/09/18 14:00 by glass