FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Text input request

 
Post new topic   Reply to topic     Forum Index -> ArcLib
View previous topic :: View next topic  
Author Message
ChristianK



Joined: 26 Sep 2006
Posts: 159
Location: Berlin, Germany

PostPosted: Mon Oct 02, 2006 2:59 pm    Post subject: Text input request Reply with quote

In FreeUniverse, we sometimes want the player to enter text, however this doesn't cut it:

Code:
arc.io.input.process();
if(arc.io.input.charHit)
{
  // add arc.io.input.lastChar to string
}


It does not work, since it is possible that two keys are pressed between two calls to process() and we'd only get the last one of the two. Also, if a key is pressed and released before process() is called, charHit will be false. (this could be intentional, but from the docs I expected charHit to mean: the user hit a character between two calls to process)

To remedy this, we have to scan through the whole symbol range with arc.io.input.keyHit(...) to check which characters have been hit and know nothing about the order of keypresses. Is there any way to accomplish this?

It would be helpful if lastChar was the array of characters that have been hit between two calls to process(), maybe with a better name (but I've no good idea myself).

If you agree with this change, I can do it myself (SVN access required) or send you a patch.
Back to top
View user's profile Send private message
ChristianK



Joined: 26 Sep 2006
Posts: 159
Location: Berlin, Germany

PostPosted: Tue Oct 10, 2006 4:38 pm    Post subject: Reply with quote

Sorry about the bump, but what are your ideas on this?
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Fri Oct 13, 2006 7:08 am    Post subject: Reply with quote

Hey I pretty much have a GUI done here ( http://www.dsource.org/projects/arcgames/browser/trunk/arc/gui ) , I'm not 100? sure on what problem you are having, but I've got a 'textfield' to work fine so if you want you could just have me finish and implement the GUI into freeuniverse.
Back to top
View user's profile Send private message AIM Address
ChristianK



Joined: 26 Sep 2006
Posts: 159
Location: Berlin, Germany

PostPosted: Sat Oct 14, 2006 8:22 am    Post subject: Reply with quote

Quote:
I'm not 100? sure on what problem you are having


Characters of the typed text are missing. Check the FreeUniverse loading screen for it. If you type fast, some characters will be dropped, for the reasons described in the first post. (conceptually, the problem should be platform-independent. I only tested it in Linux)

I will look at your text-input code though.
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Sat Oct 14, 2006 12:44 pm    Post subject: Reply with quote

Oh alright, you can make the changes to arc in the freeuniverse SVN, that is where I'm going to be developing Arc for a while (because I am developing it to cater to freeuniverse).
Back to top
View user's profile Send private message AIM Address
ChristianK



Joined: 26 Sep 2006
Posts: 159
Location: Berlin, Germany

PostPosted: Sun Oct 15, 2006 1:43 am    Post subject: Reply with quote

Okay. Were you able to reproduce the bug, though?
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Sun Oct 15, 2006 10:08 pm    Post subject: Reply with quote

I think I know what you are talking about, a while back I was wondering why my text wasn't so responsive Embarassed

but with a faster computer now it is hard to tell. you can make the change, or ask me to do it, I don't mind.
Back to top
View user's profile Send private message AIM Address
ChristianK



Joined: 26 Sep 2006
Posts: 159
Location: Berlin, Germany

PostPosted: Mon Oct 16, 2006 3:40 am    Post subject: Reply with quote

Okay, I'll make the changes then.

-- edit --

It has been fixed. lastChar renamed to lastChars.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> ArcLib All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group