Keyboard (KBD) Sample Demo

Location

$REVOLUTION_SDK_ROOT/build/demos/kbddemo

Compilation

Go to the directory $REVOLUTION_SDK_ROOT/build/demos/kbddemo and type "make". Executable (.elf) files will be generated under the path $REVOLUTION_SDK_ROOT/RVL/bin/demos/kbddemo/.

Execution

To function, all demos require a USB keyboard. A Nintendo GameCube Controller is also required for some demos.

The demos kbdUTF8 and kbdUTF8Sync require a UTF-8 compliant terminal program in order to properly view the output for non-English keyboards. This is one method we have found for properly showing the output of these demos:

  1. Run Cygwin setup program and under devel install the Cygwin package "ruby: Interpreted object-oriented scripting language".
  2. Install terminator.msi from http://software.jessies.org/terminator/.
  3. Double-click on the Terminator icon on the desktop.
  4. Exit all serial terminal programs that had been running.
  5. In the Terminator window, run "uterm comX". Here, X is the number of the serial out COM port of the NDEV you are using. Uterm is in $REVOLUTION_SDK_ROOT/X86/bin/.
  6. Running the kbdUTF8 demo.
  7. (To exit Uterm, enter CTRL+C on the PC.))

To run either of the demos, change to the $REVOLUTION_SDK_ROOT/RVL/bin/demos/kbddemo/ directory and do the following:

Description

Note: These sample demos demonstrate the use of the USB keyboard (KBD) library. To verify the operation of these demos, you must insert a USB Keyboard into a USB Port.All demos except kbdLowLevel also use a GameCube Controller plugged into Controller Port 1.

Demo Name

Description

kbdLowLevel

Shows how to use the low-level KBD callback interface. Prints the USB HID code which is output every time a key is pressed and released on the USB keyboard.

kbdUTF8

Shows how to use the high-level KBD callback interface. Translates each key press into its UTF-8 equivalent; for keys that do not have an equivalent, translates each key press into a descriptive string.

To set the next country for the keyboard, use the A Button on Nintendo GameCube Controller.

To set the previous country for the keyboard, use the B Button on Nintendo GameCube Controller.

To change the keyboard channel affected by the A or B Button, use the X Button on Nintendo GameCube Controller.

To print a sample UTF-8 string, use the Y Button on Nintendo GameCube Controller. This makes sure that your terminal program gives you proper UTF-8 output.

kbdLowLevelSync

Shows how to use the low-level interface for KBD synchronous functions.
Prints the USB HID code, which is output every time a key on the USB keyboard is pressed and released.

Use Nintendo GameCube Controller R Button to make the application sleep for 5 seconds. This makes it possible to verify overflow operation.

kbdUTF8Sync

Shows how to use the high-level interface for KBD synchronous functions.
Translates each key press into its UTF-8 equivalent; for keys that do not have an equivalent, translates each key press into a descriptive string.

To set the next country for the keyboard, use the A Button on Nintendo GameCube Controller.

To set the previous country for the keyboard, use the B Button on Nintendo GameCube Controller.

To change the keyboard channel affected by the A or B Button, use the X Button on Nintendo GameCube Controller.

To print a sample UTF-8 string, use the Y Button on Nintendo GameCube Controller. This makes sure that your terminal program gives you proper UTF-8 output.

To make the application sleep for 5 seconds, use the R Button on Nintendo GameCube Controller. This makes it possible to verify overflow operation.

In the high-level demos, we have implemented switching between the Japanese and Greek languages. For Japanese, use the Katana-Hiragana key; for Greek, use ALT+SPACE.

See Also

KBD Functions

Revision History

2007/03/20 Initial version.


CONFIDENTIAL