Static class to manage the Nintendo Wii U gamepad and remotes. It will return itself if it is tried to be instantiated. NOTE: This class is still under development.
- Source:
- To Do:
-
- Function or option that returns an array with the pressed buttons (LEFT: true, L: true, R: false, etc.). Use the bitmasks of CB_Controllers_Proprietary.WII_U.GAMEPAD_BUTTONS and CB_Controllers_Proprietary.WII_U.REMOTE_BUTTONS.
Members
-
<static, constant> GAMEPAD_BUTTONS :Object
-
Object which keeps the values for the Nintendo Wii U gamepad's buttons (bitmasks).
Type:
- Object
- Source:
Properties:
Name Type Description LEFT_STICK_LEFTnumber LEFT on the LEFT STICK. Default action: Scroll/Pan.
LEFT_STICK_RIGHTnumber RIGHT on the LEFT STICK. Default action: Scroll/Pan.
LEFT_STICK_UPnumber UP on the LEFT STICK. Default action: Scroll/Pan.
LEFT_STICK_DOWNnumber DOWN on the LEFT STICK. Default action: Scroll/Pan.
LEFT_STICK_CLICKnumber CLICK on the LEFT STICK. Default action: Hide/show bottom toolbar.
RIGHT_STICK_LEFTnumber LEFT on the RIGHT STICK. Default action: Zoom.
RIGHT_STICK_RIGHTnumber RIGHT on the RIGHT STICK. Default action: Zoom.
RIGHT_STICK_UPnumber UP on the RIGHT STICK. Default action: Zoom.
RIGHT_STICK_DOWNnumber DOWN on the RIGHT STICK. Default action: Zoom.
RIGHT_STICK_CLICKnumber CLICK on the RIGHT STICK. Default actionn: Toggle zoom in/out on center of screen.
TVnumber "TV" button.
Anumber "A" button. Send the "Enter" key (keyCode 13).
Bnumber "B" button. Default action: Back to previous page (hold B: Close current tab).
Xnumber "X" button. Default action: Toggle curtain mode.
Ynumber "Y" button. Default action: View bookmarks.
LEFTnumber LEFT button on the control pad. Default action: Select links / form fields.
RIGHTnumber RIGHT button on the control pad. Default action: Select links / form fields.
UPnumber UP button on the control pad. Default action: Select links / form fields.
DOWNnumber DOWN button on the control pad. Default action: Select links / form fields.
ZLnumber "ZL" button. Default action: Switch to previous tab (hold ZL+ZR: Tilt scrolling).
ZRnumber "ZR" button. Default action: Switch to next tab (hold ZL+ZR: Tilt scrolling).
Lnumber "L" button. Default action: Back to previous page.
Rnumber "R" button. Default action: Forward to next page.
STARTnumber "START" button.
PLUSnumber Alias for
CB_Controllers_Proprietary.WII_U.GAMEPAD_BUTTONS.START.SELECTnumber "SELECT" button.
MINUSnumber Alias for
CB_Controllers_Proprietary.WII_U.GAMEPAD_BUTTONS.SELECT.HOMEnumber HOME button. Default action: Quit browser.
-
<static, constant> REMOTE_BUTTONS :Object
-
Object which keeps the values for the Nintendo Wii U remote's buttons (bitmasks).
Type:
- Object
- Source:
Properties:
Name Type Description UPnumber UP button.
DOWNnumber DOWN button.
LEFTnumber LEFT button.
RIGHTnumber RIGHT button.
Anumber "A" button.
Bnumber "B" button.
ONEnumber "1" button.
_1number Alias for
CB_Controllers_Proprietary.WII_U.REMOTE_BUTTONS.ONE.1number Alias for
CB_Controllers_Proprietary.WII_U.REMOTE_BUTTONS.ONE.TWOnumber "2" button.
_2number Alias for
CB_Controllers_Proprietary.WII_U.REMOTE_BUTTONS.TWO.2number Alias for
CB_Controllers_Proprietary.WII_U.REMOTE_BUTTONS.TWO.PLUSnumber PLUS ("+") button.
MINUSnumber MINUS ("-") button.
HOMEnumber HOME button.
-
<static, readonly> gamepadLastStatus :Object
-
Keeps the last return value of the
CB_Controllers_Proprietary.WII_U.getGamePadStatusfunction (if any). The value should be the last status object returned.Type:
- Object
-
<static, readonly> remoteLastStatus :array
-
Keeps an array with numeric indexes (should be from 0 to 7 maximum) that belong to each remote number and whose values contain the last return value of the
CB_Controllers_Proprietary.WII_U.getRemoteStatusfunction (if any). Each value should be the last status object returned.Type:
- array
- Default Value:
-
- []
- Source:
-
<static, readonly> wiiuObject :Object
-
Keeps the "wiiu" object (if any).
Type:
- Object
Methods
-
<static> getGamePadStatus() → {Object}
-
Returns an object with the current status of each button of the gamepad. Already calls
CB_Controllers_Proprietary.WII_U.normalizeGamepadautomatically.Returns:
Returns an object with the current status of each button of the gamepad.
- Type
- Object
-
<static> getGamePads() → {Object}
-
Returns an object with the gamepad and all remotes simulating the GamePad API. Uses the
CB_Controllers_Proprietary.WII_U.getRemoteStatusandCB_Controllers_Proprietary.WII_U.getRemoteStatusinternally so the objects will be normalized already.- Source:
- To Do:
-
- Check the documentation to find out the maximum number of remotes allowed and find out whether the first index should be 0 or 1 and last one 7 or 8.
Returns:
Returns an object with two properties: "gamepads" and "remotes". Each of those two properties will have an object as value whose names will be the index of the device and the value an object with the status of that device. In the case of the gamepad (which is unique), there will only be one index ("0", zero). In the case of the remotes, it will contain the status objects of all the remotes. The number of remotes is 8 (index from "0" to "7"). Simulating the GamePad API. Those status objects which are not using the real API will have a property called "usingPrototype" set to true.
- Type
- Object
-
<static> getRemoteStatus( [n]) → {Object}
-
Returns an object with the current status of each button of the desired remote. Already calls
CB_Controllers_Proprietary.WII_U.normalizeRemoteautomatically.Parameters:
Name Type Argument Default Description ninteger <optional>
0 Number of the remote whose status we want to get, from 0 to 7 (both numbers included, 8 in total).
- Source:
- To Do:
-
- Check documentation to see whether the first index should be 0 or 1 and maximum 7 or 8.
Returns:
Returns an object with the current status of each button of the desired remote.
- Type
- Object
-
<static> normalizeGamepad(gamepadStatusObject) → {Object}
-
Normalizes the given gamepad status object, adding missing properties.
Parameters:
Name Type Description gamepadStatusObjectobject The gamepad status object that we want to normalize.
Returns:
Returns the given gamepad status object but normalized, adding missing properties.
- Type
- Object
-
<static> normalizeRemote(gamepadStatusObject [, n]) → {Object}
-
Normalizes the given remote status object, adding missing properties.
Parameters:
Name Type Argument Default Description gamepadStatusObjectobject The remote status object that we want to normalize.
ninteger <optional>
0 Number of the remote whose status we want to get, from 0 to 7 (both numbers included, 8 in total). It will be used as its identifier.
Returns:
Returns the given remote status object but normalized, adding missing properties.
- Type
- Object