Welcome! Log In Create A New Profile

Advanced

USB Keyboard?

Posted by whodares 
USB Keyboard?
January 05, 2009 10:54PM
I've added this library to my project, and this code
int main(int argc, char **argv)
{
	keyboardEvent kbData;

	// Snip	
	while( !(WPAD_ButtonsHeld(WPAD_CHAN_0) & WPAD_BUTTON_HOME) )
	{
		WPAD_ScanPads();
		KEYBOARD_ScanKeyboards();
		KEYBOARD_getEvent(&kbData);
		printf("%d was pressed\n", kbData.keysym.scancode);
	}
	// Snip
	return(0);
}

void startupApp()
{
	// Snip
	KEYBOARD_Init();
	KEYBOARD_putOnLed(USBKEYBOARD_LEDNUM);
	// Snip
}

void shutdownApp()
{
	// Snip
	KEYBOARD_Deinit();
	// Snip
}
It doesn't error, the Wiimote always responds to the Home button, but I never get a "was pressed" output. The NumLock LED doesn't come on either.

The keyboard does work in the Internet Channel though.

Anybody got any ideas?
Re: USB Keyboard?
January 06, 2009 10:44AM
I am not sure about the quality of those keyboard libraries. Also, it may or may not have issues with threading, buffering and such. Most people don't need a keyboard anyway.
Re: USB Keyboard?
January 06, 2009 11:52AM
Well, considering it's for WiiBASIC, where you need to type, I wouldn't like to type a program in using the Wiimote :-(

I've tried both libraries on the Wiibrew development page. Does anybody know of any others I can try?
Re: USB Keyboard?
January 06, 2009 06:24PM
There's an SDL port from the author of WiiApple which includes keyboard support here. I think he's using the same keyboard lib (or was using), but he's made some improvements.
Re: USB Keyboard?
January 06, 2009 06:28PM
Thanks, I'll take a look at it
Sorry, only registered users may post in this forum.

Click here to login