Keyboard Help

Stuck? This is the place to go to get and give help.

Keyboard Help

Postby Nobody » March 28th, 2011, 10:15 pm

I have the code to display the keyboard (PA_InitKeyboard), but i don't know how to get it to output the text. Also i want to check if certain text was typed, i found the function (PA_CheckKeyboard), which checks if the keyboard is being used and returns the letter, but i don't know how to use it to check the text, and declare what it is looking for. Someone please help! This is important because i'm making a project that teaches people how to use DSGM, and this is a crucial part of the simulator. :cry:
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2136
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Keyboard Help

Postby JanMulder » March 28th, 2011, 10:55 pm

Declare a char array named text. Declare an int variable named place.
Init the keyboard in a Create Event.
Then in the Step Event:
If Stylus.Newpress
Set Variable text[place] to PA_CheckKeyboard()
Set Variable place to place+1
Draw String text //and some coordinates.

I'm not really experienced with DSGM 5 but something like this will work.
here and yet not here
JanMulder
 
Posts: 759
Joined: December 30th, 2010, 3:08 pm

Re: Keyboard Help

Postby Nobody » March 30th, 2011, 12:12 am

I tried, but i keep failing. Could someone please help me. Maybe post a DSGM file someone? Well here's what i tried.
Attachments
trash.dsgm
And yes i know this probably isn't anywhere near right, but tried my best
(1.06 KiB) Downloaded 86 times
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2136
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Keyboard Help

Postby thedark » March 31st, 2011, 10:36 am

i have the same trouble...
can anyone make a working keyboard in dsgm.
i need it for a new program.
i came as far as nobody did only got log numbers but no letters.

please help !!
Workin on a DS Version of Strykers RUN Platform
Watch out for Strikers run part 1 and 2 Demo comming soon !!

If you need any help, contact me, mabe i can help out.
i am 16 hours a day on DSGM Forums. i do read a lot.
thedark
 
Posts: 263
Joined: March 14th, 2011, 9:59 am
Location: Nederland

Re: Keyboard Help

Postby Nobody » April 2nd, 2011, 2:00 am

Can anyone please help? Sorry if i'm inpatient. It's just i spent like 10 hours already pouring stuff into the game for the DSGM Helper tool i'm making, and without the keyboard, it just isn't the same.
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2136
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Keyboard Help

Postby JanMulder » April 2nd, 2011, 8:26 am

I'm not really using DSGM 5, so I'm not opening the .dsgm file. It should work the way I posted.
here and yet not here
JanMulder
 
Posts: 759
Joined: December 30th, 2010, 3:08 pm

Re: Keyboard Help

Postby thedark » April 2nd, 2011, 12:28 pm

sorry jan it wont work so as you told him to type the commands.

i have the same trouble and als do not got it to work.
the only thing is what i got ar numbers like 126701325 and so on or just 1 number 1 to x

but no text and also no delete ,ruturns ,tabs, backspace etc...

so please, any who can help us...
Workin on a DS Version of Strykers RUN Platform
Watch out for Strikers run part 1 and 2 Demo comming soon !!

If you need any help, contact me, mabe i can help out.
i am 16 hours a day on DSGM Forums. i do read a lot.
thedark
 
Posts: 263
Joined: March 14th, 2011, 9:59 am
Location: Nederland

Re: Keyboard Help

Postby Nobody » April 2nd, 2011, 7:16 pm

thedark wrote:the only thing is what i got ar numbers like 126701325


That was the most i could get out of it too. It's frustrating :|
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2136
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Keyboard Help

Postby JanMulder » April 2nd, 2011, 7:36 pm

Still it should work!

Code: Select all
char text[100];
int place = 0;
if (Pad.Newpress.A) {
PA_InitKeyboard(1);
PA_KeyboardIn(0,0);
}
if (Stylus.Newpress) {
text[place] = PA_CheckKeyboard();
place++;
}
PA_OutputText(1,0,0,"%s",text);

This is it basically, without backspace.
here and yet not here
JanMulder
 
Posts: 759
Joined: December 30th, 2010, 3:08 pm

Re: Keyboard Help

Postby Nobody » April 2nd, 2011, 7:50 pm

I can't even get the code you just uploaded to compile right :(
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2136
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Keyboard Help

Postby JanMulder » April 2nd, 2011, 7:58 pm

That's because it's C code. And the first two lines belong out of the while loop.
here and yet not here
JanMulder
 
Posts: 759
Joined: December 30th, 2010, 3:08 pm

Re: Keyboard Help

Postby Nobody » April 2nd, 2011, 8:07 pm

I don't quite understand what to do with it. It might be your directions are confusing, or I just don't know what i'm doing. I'm not a programmer either in any language, so hopefully I'm going to start learning how to program eventually.
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2136
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Keyboard Help

Postby thedark » April 3rd, 2011, 9:00 am

ehm,
only one letter is showing up, after 10 keys rom crashes.

i think there is somthing missing.
its looks almost working but it is not o.k. yet.
and i do not know how to make a "while(1)" , return(0) or a loop in dsgm 5.12
can you upload a working dsgm file as i can see what its look like (no code)

thanks
tonny
Workin on a DS Version of Strykers RUN Platform
Watch out for Strikers run part 1 and 2 Demo comming soon !!

If you need any help, contact me, mabe i can help out.
i am 16 hours a day on DSGM Forums. i do read a lot.
thedark
 
Posts: 263
Joined: March 14th, 2011, 9:59 am
Location: Nederland

Re: Keyboard Help

Postby JanMulder » April 3rd, 2011, 2:08 pm

Well, you guys kind of fail. I did exactly as I said and it worked:
KeyboardTest.dsgm
(1.06 KiB) Downloaded 117 times
here and yet not here
JanMulder
 
Posts: 759
Joined: December 30th, 2010, 3:08 pm

Re: Keyboard Help

Postby Nobody » April 3rd, 2011, 5:27 pm

JanMulder wrote:Well, you guys kind of fail. I did exactly as I said and it worked


Well that's what happens when you give noobs a task with little instructions that is in code, which we can't understand in the first place. :P

Well thank you for your time, but how could you latter rig this so you could backspace, shift, tab, and caps lock correctly without implementing blank spaces everywhere as a value???????? Also, how would i check what is outputted to see if someone outputted the right text? :?:

P.S. With this i can finally get back to working on my game that teaches people how to use DSGM.
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2136
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Keyboard Help

Postby JanMulder » April 3rd, 2011, 6:47 pm

I didn't only write it in code. I wrote it down in DSGM language in the first place.
here and yet not here
JanMulder
 
Posts: 759
Joined: December 30th, 2010, 3:08 pm

Re: Keyboard Help

Postby thedark » April 3rd, 2011, 8:00 pm

hey, i added some sound and a vieuw extra PAlib commands to it.

going to work on the extra funktions from here.

if finished its a nice tutorial item.

thanks to jan mulder..
Attachments
KeyboardTest.dsgm
Seccond version :-)
(32.68 KiB) Downloaded 90 times
Workin on a DS Version of Strykers RUN Platform
Watch out for Strikers run part 1 and 2 Demo comming soon !!

If you need any help, contact me, mabe i can help out.
i am 16 hours a day on DSGM Forums. i do read a lot.
thedark
 
Posts: 263
Joined: March 14th, 2011, 9:59 am
Location: Nederland

Re: Keyboard Help

Postby Nobody » April 3rd, 2011, 8:42 pm

Well it still confused me :(
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2136
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Keyboard Help

Postby thedark » April 3rd, 2011, 8:51 pm

what do you not understand on this?
Last edited by thedark on April 4th, 2011, 8:51 am, edited 1 time in total.
Workin on a DS Version of Strykers RUN Platform
Watch out for Strikers run part 1 and 2 Demo comming soon !!

If you need any help, contact me, mabe i can help out.
i am 16 hours a day on DSGM Forums. i do read a lot.
thedark
 
Posts: 263
Joined: March 14th, 2011, 9:59 am
Location: Nederland

Re: Keyboard Help

Postby Nobody » April 3rd, 2011, 8:59 pm

No, i get it. I was commenting back to JanMulder's post.
JanMulder wrote:I didn't only write it in code. I wrote it down in DSGM language in the first place.

Kinda forgot to do the quote thing.
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2136
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Next

Return to Help

Who is online

Users browsing this forum: No registered users and 4 guests