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 

PSP_CTRL_VOLUP

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



Joined: 19 May 2008
Posts: 28

PostPosted: Fri Sep 12, 2008 7:20 am    Post subject: PSP_CTRL_VOLUP Reply with quote

Hi,
I want to readout the state of the Volume+ Button.
I already know that I need a kernel prx and I created one with the following value:
Code:
#include <pspsdk.h>
#include <pspkernel.h>
#include <pspdisplay_kernel.h>
#include <pspctrl.h>

PSP_MODULE_INFO("testlib", 0x1006, 1, 0);
PSP_MAIN_THREAD_ATTR(0);

int getvolup()
{
   SceCtrlData libpad;
   sceCtrlPeekBufferPositive(&libpad, 1);
   
   if(libpad.Buttons & PSP_CTRL_VOLUP)
   { 
      return 1;
   } else
   {
      return 0;
   }
}

int module_start(SceSize args, void *argp)
{
   return 0;
}

int module_stop()
{
   return 0;
}

But this function always returns 0, but why?
Did I forget anything?
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Fri Sep 12, 2008 7:44 am    Post subject: Reply with quote

at the begining of the function

Code:
u32 k1;
k1 = pspSdkSetK1(0);


and at the end of the function

Code:
pspSdkSetK1(k1);

_________________

Upgrade your PSP
Back to top
View user's profile Send private message
steffven



Joined: 19 May 2008
Posts: 28

PostPosted: Fri Sep 12, 2008 10:28 pm    Post subject: Reply with quote

Thanks, it works now, but everytime i press Volume+, the psp's volume gets increased.
How do i block this input so the volume doesn't change?
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Fri Sep 12, 2008 11:20 pm    Post subject: Reply with quote

I don't really know how you can stop that, you may need to find how the volume+ and volume- buttons work.
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
steffven



Joined: 19 May 2008
Posts: 28

PostPosted: Sat Sep 13, 2008 1:30 am    Post subject: Reply with quote

Hmm how can i emulate a key press?
I could press the Volume- button virtually or does someone have another idea?
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Sat Sep 13, 2008 1:53 am    Post subject: Reply with quote

search over the forum, I remember reading something about that.
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
steffven



Joined: 19 May 2008
Posts: 28

PostPosted: Sat Sep 13, 2008 7:50 am    Post subject: Reply with quote

Hmm can't find anything...
Someone knows how to readout and set the psp's volume?
I could save the current volume and reset it after the key press.
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