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_LEFT
number LEFT on the LEFT STICK. Default action: Scroll/Pan.
LEFT_STICK_RIGHT
number RIGHT on the LEFT STICK. Default action: Scroll/Pan.
LEFT_STICK_UP
number UP on the LEFT STICK. Default action: Scroll/Pan.
LEFT_STICK_DOWN
number DOWN on the LEFT STICK. Default action: Scroll/Pan.
LEFT_STICK_CLICK
number CLICK on the LEFT STICK. Default action: Hide/show bottom toolbar.
RIGHT_STICK_LEFT
number LEFT on the RIGHT STICK. Default action: Zoom.
RIGHT_STICK_RIGHT
number RIGHT on the RIGHT STICK. Default action: Zoom.
RIGHT_STICK_UP
number UP on the RIGHT STICK. Default action: Zoom.
RIGHT_STICK_DOWN
number DOWN on the RIGHT STICK. Default action: Zoom.
RIGHT_STICK_CLICK
number CLICK on the RIGHT STICK. Default actionn: Toggle zoom in/out on center of screen.
TV
number "TV" button.
A
number "A" button. Send the "Enter" key (keyCode 13).
B
number "B" button. Default action: Back to previous page (hold B: Close current tab).
X
number "X" button. Default action: Toggle curtain mode.
Y
number "Y" button. Default action: View bookmarks.
LEFT
number LEFT button on the control pad. Default action: Select links / form fields.
RIGHT
number RIGHT button on the control pad. Default action: Select links / form fields.
UP
number UP button on the control pad. Default action: Select links / form fields.
DOWN
number DOWN button on the control pad. Default action: Select links / form fields.
ZL
number "ZL" button. Default action: Switch to previous tab (hold ZL+ZR: Tilt scrolling).
ZR
number "ZR" button. Default action: Switch to next tab (hold ZL+ZR: Tilt scrolling).
L
number "L" button. Default action: Back to previous page.
R
number "R" button. Default action: Forward to next page.
START
number "START" button.
PLUS
number Alias for
CB_Controllers_Proprietary.WII_U.GAMEPAD_BUTTONS.START
.SELECT
number "SELECT" button.
MINUS
number Alias for
CB_Controllers_Proprietary.WII_U.GAMEPAD_BUTTONS.SELECT
.HOME
number 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 UP
number UP button.
DOWN
number DOWN button.
LEFT
number LEFT button.
RIGHT
number RIGHT button.
A
number "A" button.
B
number "B" button.
ONE
number "1" button.
_1
number Alias for
CB_Controllers_Proprietary.WII_U.REMOTE_BUTTONS.ONE
.1
number Alias for
CB_Controllers_Proprietary.WII_U.REMOTE_BUTTONS.ONE
.TWO
number "2" button.
_2
number Alias for
CB_Controllers_Proprietary.WII_U.REMOTE_BUTTONS.TWO
.2
number Alias for
CB_Controllers_Proprietary.WII_U.REMOTE_BUTTONS.TWO
.PLUS
number PLUS ("+") button.
MINUS
number MINUS ("-") button.
HOME
number HOME button.
-
<static, readonly> gamepadLastStatus :Object
-
Keeps the last return value of the
CB_Controllers_Proprietary.WII_U.getGamePadStatus
function (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.getRemoteStatus
function (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.normalizeGamepad
automatically.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.getRemoteStatus
andCB_Controllers_Proprietary.WII_U.getRemoteStatus
internally 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.normalizeRemote
automatically.Parameters:
Name Type Argument Default Description n
integer <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 gamepadStatusObject
object 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 gamepadStatusObject
object The remote status object that we want to normalize.
n
integer <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