Keyboard (KBD) Sample Demos

Location

$CAFE_ROOT/system/src/demo/usb/kbd

Compilation

Go to the directory $CAFE_ROOT/system/src/demo/usb/kbd and type make. Executable files (RPX files) will be generated under the path $CAFE_ROOT/system/bin/ghs/cafe/demo/usb/kbd/[N]DEBUG/.

Execution

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

To run either of the demos, change to the $CAFE_ROOT/system/src/demo/usb/kbd/ directory and perform 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 Wii Classic Controller plugged into a Controller Port.

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 the Wii Classic Controller.
  • To set the previous country for the keyboard, use the B Button on the Wii Classic Controller.
  • To change the keyboard channel affected by the A Button or B Button, use the X Button on the Wii Classic Controller.
  • To print a sample UTF-8 string, use the Y Button on the Wii Classic Controller. This makes sure that your terminal program provides correct 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 the R Button on the Wii Classic Controller to make the application sleep for 5 seconds. This makes it possible to verify overflow operations.

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 the Wii Classic Controller.
  • To set the previous country for the keyboard, use the B Button on the Wii Classic Controller.
  • To change the keyboard channel affected by the A Button or B Button, use the X Button on the Wii Classic Controller.
  • To print a sample UTF-8 string, use the Y Button on the Wii Classic Controller.
  • To make the application sleep for 5 seconds, use the R Button on the Wii Classic Controller. This makes it possible to verify overflow operations.

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

Revision History

2014/04/30 Fix for ALT+SPACE.
2013/05/08 Automated cleanup pass.
2012/08/21 Cleanup Pass
2011/12/21 Moved to Cafe.
2007/03/20 Initial version.


CONFIDENTIAL