The basic keypad component (FISKeypad)
provides a group of related keys that are arranged in a grid-like
format. The keypad generates two events, named keyUp
and keyDown by default
(but can be changed through the component parameter panel or programmatically),
with values that accompany those events indicating which key was
pressed and which character it corresponds to (the developer specifies
an array of characters, mapping the key index to character). The
developer also can specify which keys to hide in the grid, making
it possible to create a more realistic arrangement of keys.
We have also provided an extension FISKeypadPlus
to the basic keypad that makes the keys generate repeated events
when pressed (if desired), and allows the developer to choose different
key overlays. One use would be for a virtual interface that has
a common set of buttons that changes labels on different screens.
Below, you can see in the example below how this might be used.
At the heart of these components are arrays to hold the character
mapping and the "no show" keys. With respect to mappings,
the arrays are row-major ordered (i.e., <row
0, col 0>, <row 0, col 1> , <row 0, col 2>, ... <row
0, col n>, <row 1, col 0>, ...). Note also that
developers need to leave space available in the arrays for each
key in the grid, whether it is displayed or hidden.
The arrays are indexed from 0 to (rows*cols)
-1. Movie clips in the Library > FIS Interface Components
> Skins folder define what the overlays look like in their up
(normal) state and in the down (pressed) state. Each frame corresponds
to the key index (remember, keys that are not shown still require
frames). For FISKeypadPlus,
developers make the overlay movie clip with enough frames to accommodate
all the overlays. |