forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Tips need for input issues

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
flattspott



Joined: 22 Aug 2005
Posts: 22

PostPosted: Mon Aug 22, 2005 4:16 am    Post subject: Tips need for input issues Reply with quote

Can somebody give me some tips on processing input properly please?

I understand how to go about it but it seems buggy.

Code:

function inputHandler()
   screen.waitVblankStart()
   input = Controls.read()
   if mode == 1 then
      if input:up() then
         if row == 2 then
            row = 1
         elseif row == 3 then
            row = 2
         elseif row == 4 then
            row = 3
         end
      elseif input:down() then
         if row == 1 then
            row = 2
         elseif row == 2 then
            row = 3
         elseif row == 3 then
            row = 4
         end
      elseif input:cross() then
         select()
      end
   elseif mode == 2 then
      if input:cross() or input:circle() or input:triangle() or input:square() then
         mode = 1      
      end
   end
end


Note that I have also tried doing a row = row + 1 type of deal instead of all the else if's too.

Now here's the issue, I press down or up and sometimes it's like I didn't even press anything. Other times it seems to skip ahead, going from row 1 to row 3 or 4 with just one press.

Any ideas?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 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