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 

OSLib and key presses problem

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



Joined: 08 Jan 2007
Posts: 87
Location: Australia

PostPosted: Fri Jan 12, 2007 12:26 pm    Post subject: OSLib and key presses problem Reply with quote

hi everyone,

im using the old school library to do the drawing and controller handling in my program and it has all been working fine until i started using slightly more
advance controller conditions such as holding down a trigger button then press cross or something like that anyways my problem is that while im holding down a trigger, the library recognises that teh trigger is held but not a simple press on cross it only works if cross is held as well, which for my program i need to just register a single press with no repeat
here is the structure i have
Code:
keys = oslReadKeys();
if (keys->held.L) //Works
{

   if (keys->held.up) //Works
   {
      //Some Code
   }

   if (keys->pressed.up) //Works
   {
     //Some Code
   }
               
   if (keys->held.cross) //Works
   {
      //Some Code
   }

   if (keys->pressed.cross) //DOESNT WORK
   {
      //Some Code
   }

}


does anyone know a fix for this using OSLib or can anyone explain to me how i can get the standard sony functions to make a key only register one press with out repeating????

Thanks in advance
Back to top
View user's profile Send private message
reefbarman



Joined: 08 Jan 2007
Posts: 87
Location: Australia

PostPosted: Sat Jan 13, 2007 12:05 am    Post subject: Reply with quote

now i can work with this as im using a flag that only allows the action of the button to happen every second which you can imagine is less than perfect and amounts to slow input times, i think my best solution would be finding out how to catch key presses with the sony code cause i think my problem is maybe a bug in OSLib??? so if anyone knows which code works only once per button press that would be great as i cant find much documentation
Back to top
View user's profile Send private message
reefbarman



Joined: 08 Jan 2007
Posts: 87
Location: Australia

PostPosted: Sat Jan 13, 2007 1:39 pm    Post subject: Reply with quote

okay i now im being really annoying, but the problem im having is a real bitch as the work around i have used to stop my code from running more that once is time based so the code when a key is press will only work when a second has past and the flag has been changed to ready so you can see it would result in fairly slow input.

Ill try and make myself more clear as well

i need to know how to read a key without any repeats so code only executes once per press of a button using any of sce functions, their is not enough documention on it for me to get it to work myself and OSLib wont let the key presses of cross,triangle,square and circle be read if any other button is being held.

please can someone shed some light from the heavens on me cause i really need fast and accurate input in my app
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 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