OSLib and key presses problem

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
reefbarman
Posts: 87
Joined: Mon Jan 08, 2007 12:16 pm
Location: Australia

OSLib and key presses problem

Post by reefbarman »

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: Select all

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
reefbarman
Posts: 87
Joined: Mon Jan 08, 2007 12:16 pm
Location: Australia

Post by reefbarman »

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
reefbarman
Posts: 87
Joined: Mon Jan 08, 2007 12:16 pm
Location: Australia

Post by reefbarman »

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