| View previous topic :: View next topic |
| Author |
Message |
PsPfReAK
Joined: 28 Mar 2009 Posts: 61
|
Posted: Tue Nov 03, 2009 4:58 am Post subject: How To Change Button Function |
|
|
Right, so what i want to know is how do i changed button input.
For example if i press select, i want it to press start, ive tried this so far but with no luck
| Code: | int main_thread(SceSize args, void *argp)
{
SceCtrlData pad;
while(1) // loop is required so buttons get checked more than ONCE
{
sceCtrlReadBufferPositive(&pad, 1); // update the var inside the loop
if(pad.Buttons & PSP_CTRL_CROSS)
{
PSP_CTRL_SELECT;
}
sceKernelDelayThread(100000);// don't use processor for around 1/10 of a second
}
return 0;
} |
Obvs PSP_CTRL_SELECT; is wrong, i dont know how to do it. |
|
| Back to top |
|
 |
Criptych
Joined: 12 Sep 2009 Posts: 79
|
Posted: Tue Nov 03, 2009 5:53 am Post subject: |
|
|
As far as the compiler cares, "PSP_CTRL_SELECT" is just a value; to do something with it you need to make that line into a statement. For instance:
| Code: | if(pad.Buttons & PSP_CTRL_CROSS)
{
pad.Buttons |= PSP_CTRL_SELECT;
} |
Better yet, write the bits to another variable so you don't overwrite the values you got from the controller, since this would mess up if you then tried to remap the Select button to something else. |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Tue Nov 03, 2009 2:07 pm Post subject: |
|
|
| Look at RemaPSP source. The apihook functions can be replaced with sctrlHENFindFunction and sctrlHENPatchSyscall. |
|
| Back to top |
|
 |
|