The keyboard controller class is an emulation layer responsible for mapping
keyboard presses to Wii Remote button presses. This functionality is only
active when the Flash movie is run on a desktop computer. The functions
contained in this class have no effect when run on the Nintendo Wii.
The default keyboard mappings are listed in the table below. These may
be changed by calling the setKeyMapping() function. Standard Flash key
codes should be used when remapping keys to Wii Remote buttons.
Key Mappings:
| Wii Remote | Keyboard |
| Directional Pad | Arrow Keys |
| 1 | A |
| 2 | S |
| A | D |
| B | Space Bar |
| + | =/+ |
| - | -/_ |
static public function getButtonMappingForKey(keyCode:Number):Number
Returns the Wii Remote Button mapped to the passed keyboard key.
If no button is defined for that key, undefined is
returned. Keyboard keys are represented by the same numerical codes
used by the Flash Key object. Wii Remote buttons are
represented by the BUTTON_<name> constants on the
WiiRemote class.
keyCode | The key code to find the mapping for. |
The BUTTON value mapped to the key code.
static public function getKeyMappingForButton(buttonCode:Number):Number
Returns the keyboard key mapped to a given Wii Remote button. Keyboard
keys are represented by the same numerical codes used by the Flash
Key object. Wii Remote buttons are represented by the
BUTTON_<name> constants on the
WiiRemote class.
buttonCode | One of the WiiRemote.BUTTON_<name> constants.
|
The key code mapped to the Wii Remote button.
static public function setKeyMapping(buttonCode:Number, keyCode:Number):Void
Sets a new keyboard key mapping for a given Wii Remote button. If
the key is already in use, its existing mapping will be deleted
and replaced with the new mapping. Be careful when reassigning
mappings, as this could leave some Wii Remote buttons unmapped.
Keyboard keys are represented by the same numerical codes used by
the Flash Key object. Wii Remote buttons are represented
by the BUTTON_<name> constants on the
WiiRemote class.
See the Keyboard Keys and Key Code Values page of the
Learning ActionScript 2.0 in Flash online help document for
more information. The Flash online help can be viewed by
pressing the F1 key in the Flash Integrated Development Environment.
buttonCode | One of the WiiRemote.BUTTON_<name> constants.
|
keyCode | A key code to map to the Wii Remote button |