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

Difference between revisions of "Libwiikeyboard"

From WiiBrew
Jump to navigation Jump to search
(New page: {{Infobox homebrewapp | image = | title = libusbkbd | desc = A library for usb keyboard usage | type = Library | author = Cboomf |...)
 
Line 1: Line 1:
 
{{Infobox homebrewapp
 
{{Infobox homebrewapp
 
| image      =  
 
| image      =  
| title      = [[User:Cboomf/libusbkbd|libusbkbd]]
+
| title      = [[User:Davyg/libwiikeyboard|libwiikeyboard]]
 
| desc        = A library for usb keyboard usage
 
| desc        = A library for usb keyboard usage
 
| type        = Library
 
| type        = Library
| author      = Cboomf
+
| author      = davyg
| download    = ''not yet''
+
| download    = http://wiibrew.org/wiki/Image:Libwiikeyboard.tar.bz2
 
| peripherals = {{USBKeyboard}}
 
| peripherals = {{USBKeyboard}}
 
}}
 
}}

Revision as of 12:43, 30 July 2008

libwiikeyboard
General
Author(s)davyg
TypeLibrary
Links
Download
Peripherals
USB Keyboard

Libwiikeyboard

Presentation

A library who permit to use one or more usbkeyboard on the wii using libogc and devkitpro.
It use directly the USB function and not the /dev/usb/kbd

Download

Include and .a : http://wiibrew.org/wiki/Image:Libwiikeyboard.tar.bz2
Source : http://wiibrew.org/wiki/Image:Libwiikeyboard.tar.bz2

Compilation

make

Installation

make install or
copy lib/libwiikeyboard in libogc/lib/wii and include/* in libogc/include/wiikeyboard

Usage

To initialize :

USB_Initialize();
USBKeyboard_Initialize();
KEYBOARD_Init();

In your main loop :

KEYBOARD_ScanKeyboards();

To get an event :

KEYBOARD_getEvent(keyboardEvent *event)

At the end :

KEYBOARD_Deinit();
USBKeyboard_Deinitialize();
USB_Deinitialize();

Useful enum or struct :

typedef enum
{
	KEYBOARD_PRESSED = 0,
	KEYBOARD_RELEASED,
	KEYBOARD_DISCONNECTED,
	KEYBOARD_CONNECTED

}keyboard_eventType;

typedef struct _keyboard_keysym
{  
	u8 scancode;
	KEYBOARD_KEY sym;
	char ch;
	KEYBOARD_MOD mod;

}keyboard_keysym;

typedef struct _KeyboardEvent{
	keyboard_eventType type;
	keyboard_keysym keysym;
	device dev;

}keyboardEvent;

Todo

-Use the interrupt pipe in stead of control pipe
-Make the localization for other keyboard like AZERTY