| View previous topic :: View next topic |
| Author |
Message |
steffven
Joined: 19 May 2008 Posts: 28
|
Posted: Fri Sep 12, 2008 7:20 am Post subject: PSP_CTRL_VOLUP |
|
|
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 |
|
 |
Pirata Nervo
Joined: 09 Oct 2007 Posts: 409
|
Posted: Fri Sep 12, 2008 7:44 am Post subject: |
|
|
at the begining of the function
| Code: | u32 k1;
k1 = pspSdkSetK1(0); |
and at the end of the function
_________________
Upgrade your PSP |
|
| Back to top |
|
 |
steffven
Joined: 19 May 2008 Posts: 28
|
Posted: Fri Sep 12, 2008 10:28 pm Post subject: |
|
|
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 |
|
 |
Pirata Nervo
Joined: 09 Oct 2007 Posts: 409
|
Posted: Fri Sep 12, 2008 11:20 pm Post subject: |
|
|
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 |
|
 |
steffven
Joined: 19 May 2008 Posts: 28
|
Posted: Sat Sep 13, 2008 1:30 am Post subject: |
|
|
Hmm how can i emulate a key press?
I could press the Volume- button virtually or does someone have another idea? |
|
| Back to top |
|
 |
Pirata Nervo
Joined: 09 Oct 2007 Posts: 409
|
Posted: Sat Sep 13, 2008 1:53 am Post subject: |
|
|
search over the forum, I remember reading something about that. _________________
Upgrade your PSP |
|
| Back to top |
|
 |
steffven
Joined: 19 May 2008 Posts: 28
|
Posted: Sat Sep 13, 2008 7:50 am Post subject: |
|
|
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 |
|
 |
|