libosk

From WiiBrew
Jump to navigation Jump to search

libosk
General
Author(s)beardface
TypeLibrary
Version0.4.4
Links
Download
Source

libosk (OnScreenKeyboard Library) is an easy to use, 100% configurable on screen keyboard for Wii applications written by beardface. Language, look and feel, etc can all be easily changed simply by modifying a config file.

A demo application showing how to use libosk is included in the release.

Development Guide

Development libraries used

Coding with libosk

Steps to using an OnScreenKeyboard in your application:

In Header

#include "OnScreenKeyboard.h"
#include "wiisprite.h"

Init fat, libwiisprite (GameWindow) and Wiimote

//... in main
fatInitDefault();

wsp::GameWindow gwd;
gwd.InitVideo();

WPAD_Init();
WPAD_SetDataFormat(WPAD_CHAN_0, WPAD_FMT_BTNS_ACC_IR);

Construct OnScreenKeyboard

OnScreenKeyboard* osk = new OnScreenKeyboard(&gwd, "/config/key_config.xml");

Make as many calls to the library as you'd like, getting a new string, or editting strings

char* ret_string = osk->GetString();
//Or edit your string
ret_string = osk->EditString(ret_string);

Building your app that uses libosk

Change your makefile to include the following libraries

-losk -lmxml -lwiisprite

Custom Keyboard Configuration

Images: To change look and feel, simply change the images your keyboard config file (xml) references.

Font: Simply change the font file your app references, (Must be a bitmap font (see included font for example)), converted to png. (TIP, use alpha channel)

Language: To change language, simply modify the keys used in the config file.