In memory of Ben “bushing” Byer, who passed away on Monday, February 8th, 2016.

Difference between revisions of "Internet Browser"

From WiiUBrew
Jump to navigation Jump to search
(Creating page for Wii U features of Internet Browser)
 
(Finish documenting browser controls)
Line 4: Line 4:
 
Under normal circumstances, the Internet Browser uses the following controls:
 
Under normal circumstances, the Internet Browser uses the following controls:
  
* Left Analog Stick: Scroll/Pan
+
{| class='wikitable'
* Left Analog Stick Click: Hide/show bottom toolbar
+
| Left Stick  
* Right Analog Stick: Zoom
+
| Scroll/Pan
* Right Analog Stick Click: Return to default zoom
+
|-
* + button: Zoom in
+
| Click Left Stick
* - button: Zoom out
+
| Hide/show bottom toolbar
* L button: Back to previous page
+
|-
* R button: Forward to next page
+
| Right Stick  
* A button: Send the "Enter" key (keyCode 13)
+
| Zoom
 +
|-
 +
| Click Right Stick
 +
| Toggle zoom in/out on center of screen
 +
|-
 +
| + button  
 +
| Zoom in
 +
|-
 +
| - button  
 +
| Zoom out
 +
|-
 +
| L button
 +
| Back to previous page
 +
|-
 +
| R button
 +
| Forward to next page
 +
|-
 +
| ZL button
 +
| Switch to previous tab
 +
|-
 +
| ZR button
 +
| Switch to next tab
 +
|-
 +
| Hold ZL+ZR
 +
| Tilt scrolling
 +
|-
 +
| D-pad
 +
| Select links / form fields
 +
|-
 +
| A button
 +
| Send the "Enter" key (keyCode 13)
 +
|-
 +
| B button
 +
| Back to previous page
 +
|-
 +
| Hold B button
 +
| Close current tab
 +
|-
 +
| Y button
 +
| View bookmarks
 +
|-
 +
| X button
 +
| Toggle curtain mode
 +
|-
 +
| Home button
 +
| Quit browser
 +
|-
 +
| Tap screen
 +
| Click page elements
 +
|-
 +
| Double-tap screen
 +
| Zoom in/out on point
 +
|-
 +
| Touch drag
 +
| Scroll/Pan
 +
|}
  
In addition, dragging on the touch screen scrolls the window and tapping on the touch screen will click links and buttons, as is typical for touch screen browsers.
+
Some of these functions can be disabled by markup on a web page.
 
 
<b>TODO:</b> <i>Document ZL, ZR, X, Y, and B.</i>
 
  
 
== Wii U Scripting Functionality ==
 
== Wii U Scripting Functionality ==

Revision as of 00:54, 27 November 2012

The Internet Browser is a web browser preloaded on the Wii U. It uses a version of NetFront based on the WebKit rendering engine.

Controls

Under normal circumstances, the Internet Browser uses the following controls:

Left Stick Scroll/Pan
Click Left Stick Hide/show bottom toolbar
Right Stick Zoom
Click Right Stick Toggle zoom in/out on center of screen
+ button Zoom in
- button Zoom out
L button Back to previous page
R button Forward to next page
ZL button Switch to previous tab
ZR button Switch to next tab
Hold ZL+ZR Tilt scrolling
D-pad Select links / form fields
A button Send the "Enter" key (keyCode 13)
B button Back to previous page
Hold B button Close current tab
Y button View bookmarks
X button Toggle curtain mode
Home button Quit browser
Tap screen Click page elements
Double-tap screen Zoom in/out on point
Touch drag Scroll/Pan

Some of these functions can be disabled by markup on a web page.

Wii U Scripting Functionality

In addition to W3C standard touch screen functionality, the Internet Browser exposes many Wii U input and output functions to Javascript through the wiiu object.

wiiu.gamepad

The wiiu.gamepad object allows Javascript functions to read the current state of the primary Game Pad.

TODO: Figure out what contentX, contentY, and isDataValid are.

Reading values

In order to read any values from the Wii Remote, input must first be enabled by setting wiiu.remote.isEnabled = 1.

Once enabled, the function wiiu.gamepad.update() will populate all of the properties on the wiiu.gamepad object with the current information about the sticks, accelerometers, gyroscopes, buttons, and touch screen. It is safe to invoke this function in a timer for real-time updates.

Touch Screen

The wiiu.gamepad.tpTouch variable indicates whether or not there is currently an active touch on the screen. If this variable is 1, the variables wiiu.gamepad.tpX and wiiu.gamepad.tpY track the coordinates of this touch. The Game Pad's touch screen is not multitouch.

TODO: Document range of tpX and tpY. Determine meaning of tpValidity.

Analog Sticks

The left analog stick is tracked by the wiiu.gamepad.lStickX and wiiu.gamepad.lStickY variables, and the right analog stick is tracked by the wiiu.gamepad.rStickX and wiiu.gamepad.rStickY variables. These values range from -1.0 to +1.0.

Buttons

The variable wiiu.gamepad.held is a bitmask indicating all buttons currently being depressed on the Game Pad, including the click states of the analog sticks. All buttons are represented by in this bitmask although the browser's default behaviors may cause some values to be unusable.

TODO: Record what values in the bitmask correspond to which buttons on the Game Pad.

Accelerometer

The variables wiiu.gamepad.accX, wiiu.gamepad.accY, and wiiu.gamepad.accZ are a vector showing the current acceleration forces on the Game Pad, measured in Gs. When held level and motionless, the force of gravity will cause these variables to contain the vector (0.0, -1.0, 0.0).

Gyroscope

The variables wiiu.gamepad.gyroX, wiiu.gamepad.gyroY, and wiiu.gamepad.gyroZ contain the current readings of the Game Pad gyroscopes.

TODO: Determine range and geometric interpretation of these variables.

Angle

The variables wiiu.gamepad.angleX, wiiu.gamepad.angleY, and wiiu.gamepad.angleZ contain the current angle of the Game Pad.

TODO: Determine range and geometric interpretation of these variables.

Direction Tracking

There are nine variables that tie into the Game Pad's direction tracking, organized into three triplets:

  • wiiu.gamepad.dirXx, wiiu.gamepad.dirXy, wiiu.gamepad.dirXz
  • wiiu.gamepad.dirYx, wiiu.gamepad.dirYy, wiiu.gamepad.dirYz
  • wiiu.gamepad.dirZx, wiiu.gamepad.dirZy, wiiu.gamepad.dirZz

TODO: Determine range and geometric interpretation of these variables. They appear to be rotation-related. Are these triplets transposed? (i.e. are they associated as (dirXx, dirYx, dirZx) instead of (dirXx, dirXy, dirXz)?)

wiiu.remote

The wiiu.remote object allows Javascript functions to read the current state of the primary Wii Remote and its Motion Plus accessory.

TODO: Determine if it's possible to read the accessories and the second through fourth Wii Remotes like the Wii's Internet Channel could.

TODO: Figure out what contentX, contentY, and isDataValid are.

Reading values

In order to read any values from the Wii Remote, input must first be enabled by setting wiiu.remote.isEnabled = 1.

Once enabled, the function wiiu.remote.update() will populate all of the properties on the wiiu.remote object with the current information (about what?). It is safe to invoke this function in a timer for real-time updates.

Buttons

The variable wiiu.remote.held is a bitmask indicating all buttons currently being depressed on the Wii Remote.

TODO: Record what values in the bitmask correspond to which buttons on the Game Pad.

Accelerometer

The variables wiiu.remote.accX, wiiu.remote.accY, and wiiu.remote.accZ are a vector showing the current acceleration forces on the Wii Remote, measured in Gs. When held level and motionless, the force of gravity will cause these variables to contain the vector (0.0, -1.0, 0.0).

D-Pad

TODO: Document.

Motion Plus

TODO: Document.

wiiu.videoplayer

The wiiu.videoplayer object exposes the property viewMode and the function end().

TODO: Figure out what this is and how to use it.

wiiu.imageview

The wiiu.videoplayer object exposes the property viewMode and the functions end() and getErrorCode().

TODO: Figure out what this is and how to use it.