Help with nds virtual keyboard examples

Post Reply
mox
Posts: 6
Joined: Mon Apr 22, 2013 9:34 am

Help with nds virtual keyboard examples

Post by mox » Mon Apr 22, 2013 9:42 am

First time poster :)

I've got an nds program that is working ok so far, but I really need too add a virtual keyboard to it.
Not having much luck so far working out how to make use of the stuff in examples/nds/input/keyboard

I'm setting up my screens like this:
PrintConsole topScreen;
PrintConsole bottomScreen;

videoSetMode(MODE_0_2D);
videoSetModeSub(MODE_0_2D);

vramSetBankA(VRAM_A_MAIN_BG);
vramSetBankC(VRAM_C_SUB_BG);

consoleInit(&topScreen, 3,BgType_Text4bpp, BgSize_T_256x256, 31, 0, true, true);
consoleInit(&bottomScreen, 3,BgType_Text4bpp, BgSize_T_256x256, 31, 0, false, true);

Any suggestions how to get started setting up a virtual keyboard (on the bottom screen) would be appreciated !

elhobbs
Posts: 358
Joined: Thu Jul 02, 2009 1:19 pm

Re: Help with nds virtual keyboard examples

Post by elhobbs » Tue Apr 23, 2013 5:01 pm

keyboardDemoInit installs the keyboard on the subscreen for layer 3.

Code: Select all

keyboardInit(NULL, 3, BgType_Text4bpp, BgSize_T_256x512, defaultKeyboard.mapBase, defaultKeyboard.tileBase, false, true);
It is hard to give advice for layers and map/tile bases without knowing what (if anything) you want to use - vram, layers, etc - or maybe explain why keyboardDemoInit wont work for you.

mox
Posts: 6
Joined: Mon Apr 22, 2013 9:34 am

Re: Help with nds virtual keyboard examples

Post by mox » Tue Apr 23, 2013 6:07 pm

Well .. I'm able to build keyboard_stdin.nds, however it complains:
"Sorry, no$gba needs a copy of the original GBA BIOS (in a file named gba.rom or no$gba.rom) to execute BIOS sound functions."

My own project compiles and runs without this warning .. I don't need access to sound functions, I'm not sure how/where they are getting pulled in when using the keyboard_stdin.pnproj example.

elhobbs
Posts: 358
Joined: Thu Jul 02, 2009 1:19 pm

Re: Help with nds virtual keyboard examples

Post by elhobbs » Wed Apr 24, 2013 11:14 pm

Try desmume instead - or better yet, a real ds!

mox
Posts: 6
Joined: Mon Apr 22, 2013 9:34 am

Re: Help with nds virtual keyboard examples

Post by mox » Sun Apr 28, 2013 9:42 am

Ok cool, desmume works without complaint.

I'm not sure how to use both of the screens ? For the most part, I only need to print text, which works great for me in my own project using either consoleSelect(&bottomScreen); or consoleSelect(&topScreen); and print statements. (But with no keyboard)

How can I do this, adding these from template.c has no obvious effect ?
keyboardDemoInit();
keyboardShow();

I assume I'm not using the right screen modes or something like this ..

mox
Posts: 6
Joined: Mon Apr 22, 2013 9:34 am

Re: Help with nds virtual keyboard examples

Post by mox » Fri May 10, 2013 1:37 pm

Update: Maybe I should rephrase the question slightly :)

I can get example projects that use the keyboard (like examples/nds/input/keyboard/keyboard_stdin) to work ok.
I can get example projects that print to both screens (like examples/nds/Graphics/Printing/print_both_screens) to work ok.

What I'm missing is how to get the keyboard use and printing to the both screens working together ?

Does anyone have any suggestions about how to update either of these examples as a way to show how to do this ?

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests