Keyboard Help

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

Re: Keyboard Help

Postby thedark » April 9th, 2011, 9:22 pm

whe almost need a keyboard tab in dsgm :-)
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 10th, 2011, 12:11 am

thedark wrote:whe almost need a keyboard tab in dsgm :-)

Agreed. It started out as a simple question, and now it's this complex system of everyone working together to produce the perfect keyboard actions.
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: 2196
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Keyboard Help

Postby Foxi4 » April 10th, 2011, 1:43 am

I don't think a whole new tab is necessary. I'd add the keyboard controllers to "Control" and outputs to "Display".
Current Projects:

FalloutDS: Postponed until proper libraries are created, 10%
Foxi_Lib: A completely revised version of NitroSprites[FINAL], NitroBackgrounds and NitroText[FINAL], 40%
Foxi4
 
Posts: 1221
Joined: December 31st, 2010, 3:25 am

Re: Keyboard Help

Postby Nobody » April 10th, 2011, 3:52 pm

Foxi4, it was a joke. Also i made the If Enter pressed action and I also added a new action for those who dislike the keys staying lit up after the key is pressed. It is called Disable Key Lights. This action will still make the keys light up, but they won't stay lit up. Also i tried adding that code into the actions to be key specific but failed do to one error i can't figure out. Here's the action anyways. Could someone fix it please.
Attachments
Disable Key Lights.action
Makes pressed keys not stay lit up
(86 Bytes) Downloaded 46 times
If Enter Pressed.action
If statement where you then list actions that follow
(98 Bytes) Downloaded 42 times
Keyboard Text 2.action
Is a bad action and doesn't work. Could someone fix it
(364 Bytes) Downloaded 46 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: 2196
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Keyboard Help

Postby thedark » April 10th, 2011, 4:35 pm

what error do you get
if it is in the enter action?
or is it in the key lights?

but you wanted it to be in one of the existing actions ?

i have seen you use the keyboard icons.
nice.......
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 10th, 2011, 5:00 pm

It's the Keyboard Text 2 action. I was trying to add if specific keys were hit then move the placeholder differently, but i couldn't get it to work. I keep getting a compile error which meant i typed some of the code wrong, but i don't know how to fix it. And thanks for the compliment.
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: 2196
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Keyboard Help

Postby thedark » April 10th, 2011, 6:20 pm

a bit of an idea

!1! = PA_CheckKeyboard();
if (PA_CheckKeyboard() > 31) { // when key is bigger than 31 then var = var +1
++ !2!;
}
if (PA_CheckKeyboard() = PA_BACKSPACE) {
-- !2! ;
}

PA_OutputText( !3!, !4!, !5!, "%s", !6!);

is this what you want ?
Last edited by thedark on April 10th, 2011, 9:37 pm, 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 JanMulder » April 10th, 2011, 6:35 pm

I keep getting a compile error

Probably, I can help if you tell me what's in the compile error...
here and yet not here
JanMulder
 
Posts: 755
Joined: December 30th, 2010, 3:08 pm

Re: Keyboard Help

Postby thedark » April 10th, 2011, 6:50 pm

here i send you the error !!
Attachments
error.png
this the error i get
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 Foxi4 » April 10th, 2011, 6:52 pm

Code: Select all
TYPE 5
DISPLAY Keyboard Text 2
ICON Draw keyboard text.png
CONDITION 0
ARG String,3
ARG Placeholder,3
ARG Screen (0-1),0
ARG X (0-31),0
ARG Y (0-19),0
ARG Text Variable,3
!1![!2!] = PA_CheckKeyboard();
if (PA_CheckKeyboard() > 31) {
++!2!;
}
if (PA_CheckKeyboard() == PA_BACKSPACE) {
if (!2! > 0) {
--!2!;
}
}
PA_OutputText( !3!, !4!, !5!, "%s", !6!);


Try this then. You forgot to add the Placeholder into the String[HERE]. Errors in if statements too. Also changed Placeholder = Placeholder +/- 1 to ++Placeholder or --Placeholder. Easier.

Locked out backspace if Placeholder = 0, too.

The keys aren't staying lit if you manually choose the Keyboard color too.

Why didn't you just copy-paste the pre-prepared code on the previous page, I have no idea. But, if you want to have your own version of it, be my guest. :)
Last edited by Foxi4 on April 10th, 2011, 7:34 pm, edited 1 time in total.
Current Projects:

FalloutDS: Postponed until proper libraries are created, 10%
Foxi_Lib: A completely revised version of NitroSprites[FINAL], NitroBackgrounds and NitroText[FINAL], 40%
Foxi4
 
Posts: 1221
Joined: December 31st, 2010, 3:25 am

Re: Keyboard Help

Postby Nobody » April 10th, 2011, 7:13 pm

Again a compile error, this time using Foxi4's code:

C:\DSGMTempKeyboardTest57212802>make
Build process start for project "DSGMTempKeyboardTest57212802"...
.
main.c
In file included from c:/DSGMTempKeyboardTest57212802/source/main.c:6:0:
c:/DSGMTempKeyboardTest57212802/include/GameWorks.h: In function 'Object_1Step_E
vent':
c:/DSGMTempKeyboardTest57212802/include/GameWorks.h:41:5: error: lvalue required
as left operand of assignment
make[1]: *** [main.o] Error 1
make: *** [build] Error 2

C:\DSGMTempKeyboardTest57212802>pause
Press any key to continue . . .
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: 2196
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Keyboard Help

Postby JanMulder » April 10th, 2011, 7:32 pm

Nobody wrote:Again a compile error, this time using Foxi4's code:

C:\DSGMTempKeyboardTest57212802>make
Build process start for project "DSGMTempKeyboardTest57212802"...
.
main.c
In file included from c:/DSGMTempKeyboardTest57212802/source/main.c:6:0:
c:/DSGMTempKeyboardTest57212802/include/GameWorks.h: In function 'Object_1Step_E
vent':
c:/DSGMTempKeyboardTest57212802/include/GameWorks.h:41:5: error: lvalue required
as left operand of assignment
make[1]: *** [main.o] Error 1
make: *** [build] Error 2

C:\DSGMTempKeyboardTest57212802>pause
Press any key to continue . . .


That's because Foxi did this:
PA_CheckKeyboard() = PA_BACKSPACE

instead of:
PA_CheckKeyboard() == PA_BACKSPACE
here and yet not here
JanMulder
 
Posts: 755
Joined: December 30th, 2010, 3:08 pm

Re: Keyboard Help

Postby thedark » April 10th, 2011, 7:33 pm

pasta.png
dSGM sep event
mayonaise.png
met deze error
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 Foxi4 » April 10th, 2011, 7:35 pm

JanMulder wrote:
Nobody wrote:Again a compile error, this time using Foxi4's code:

C:\DSGMTempKeyboardTest57212802>make
Build process start for project "DSGMTempKeyboardTest57212802"...
.
main.c
In file included from c:/DSGMTempKeyboardTest57212802/source/main.c:6:0:
c:/DSGMTempKeyboardTest57212802/include/GameWorks.h: In function 'Object_1Step_E
vent':
c:/DSGMTempKeyboardTest57212802/include/GameWorks.h:41:5: error: lvalue required
as left operand of assignment
make[1]: *** [main.o] Error 1
make: *** [build] Error 2

C:\DSGMTempKeyboardTest57212802>pause
Press any key to continue . . .


That's because Foxi did this:
PA_CheckKeyboard() = PA_BACKSPACE

instead of:
PA_CheckKeyboard() == PA_BACKSPACE


Right, I didn't notice that. It was in Nobody's action though, not mine, I think. In any case, Fixed now.
Current Projects:

FalloutDS: Postponed until proper libraries are created, 10%
Foxi_Lib: A completely revised version of NitroSprites[FINAL], NitroBackgrounds and NitroText[FINAL], 40%
Foxi4
 
Posts: 1221
Joined: December 31st, 2010, 3:25 am

Re: Keyboard Help

Postby Nobody » April 10th, 2011, 7:49 pm

Ohhhhhh..... That makes since. Ok i fixed the action and i added the enter button which i forgot last time. So i've re-uploaded the Keyboard Text 2 action as Keyboard Text action so it will replace the old keyboard text action. Know that is out the way; how would you clear the text?

EDIT: Re-updated the action because the shift and caps wasn't working, but now it's fixed
Attachments
Keyboard Text.action
Complete Keyboard Action
(571 Bytes) Downloaded 41 times
Last edited by Nobody on April 10th, 2011, 8:16 pm, edited 1 time in total.
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: 2196
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Keyboard Help

Postby thedark » April 10th, 2011, 7:52 pm

!1![!2!] == PA_CheckKeyboard(); // watch out for the == and the ++ thanks to jan
if (PA_CheckKeyboard() > 31) {
++!2!;
}
if (PA_CheckKeyboard() == PA_BACKSPACE) {
if (!2! > 0) {
--!2!;
}
}
PA_OutputText( !3!, !4!, !5!, "%s", !6!);
// rest is up to you again
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 10th, 2011, 8:17 pm

I fixed the file above because it lacked shift and caps
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: 2196
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Keyboard Help

Postby JanMulder » April 10th, 2011, 8:19 pm

!1![!2!] == PA_CheckKeyboard(); // watch out for the == and the ++ thanks to jan

Incorrect. This should be only one =. In an IF-statement it's a == else it's just a =.
here and yet not here
JanMulder
 
Posts: 755
Joined: December 30th, 2010, 3:08 pm

Re: Keyboard Help

Postby Nobody » April 10th, 2011, 8:33 pm

Jan, how would you go about clearing the string or setting a placeholder to a blank space without pressing a key?
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: 2196
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: Keyboard Help

Postby thedark » April 10th, 2011, 8:53 pm

Jan and me has made this action for you.
now whe can make a demo include all actions make it a nice package.
and i can work on the next project.

Clear typed.action

TYPE 3
DISPLAY Clear typed
ICON Delete keyboard.png
CONDITION 0
ARG Placeholder,0
ARG Text Variable ,0
memset(!2!,' ',!1!);
!1!= 0;

this removes all tekst that has been typed
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

PreviousNext

Return to Help

Who is online

Users browsing this forum: Google [Bot] and 1 guest