Tips need for input issues

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
flattspott
Posts: 22
Joined: Mon Aug 22, 2005 4:06 am

Tips need for input issues

Post by flattspott »

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

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

Code: Select all

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?
Post Reply