 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
poison
Joined: 14 Dec 2006 Posts: 17
|
Posted: Wed Apr 11, 2007 5:15 pm Post subject: Creat a button event. |
|
|
It took me 2 hours searching the forums but I got no infomation about that.
I want to make my prog able to creat a press event, so that I can swap buttons.
although I found these in pspctrl_kernel.h
| Quote: |
/**
* Set the controller button masks
*
* @param mask - The bits to setup
* @param type - The type of operation (0 clear, 1 set mask, 2 set button)
*
* @par Example:
* @code
* sceCtrl_driver_7CA723DC(0xFFFF, 1); // Mask lower 16bits
* sceCtrl_driver_7CA723DC(0x10000, 2); // Always return HOME key
* // Do something
* sceCtrl_driver_7CA723DC(0x10000, 0); // Unset HOME key
* sceCtrl_driver_7CA723DC(0xFFFF, 0); // Unset mask
* @endcode
*/
void sceCtrlSetButtonMasks(unsigned int mask, unsigned type);
void sceCtrlGetButtonMask(unsigned int mask);
void sceCtrlRegisterButtonCallback(int no, unsigned int mask, void (*cb)(int, int, void*), void *arg);
|
I can mask keys use sceCtrlSetButtonMasks by passing type 1, but if I pass 2 as type like the sample, it just mask the keys and no return.
for example:
sceCtrl_driver_7CA723DC(PSP_CTRL_RTRIGGER, 1); //It mask the R button normally.
sceCtrl_driver_7CA723DC(PSP_CTRL_CROSS, 2); //It should return Cross but actually it just mask the Cross as well .
Can anybody share me some idea? |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Thu Apr 12, 2007 2:23 am Post subject: |
|
|
| I am not sure if those functions allow you to set low bits, i.e. normal buttons, however I would have thought so. Tbh if all you want to do is swap buttons you are better off hooking the controller functions. It is easy enough to do :P |
|
| Back to top |
|
 |
poison
Joined: 14 Dec 2006 Posts: 17
|
Posted: Thu Apr 12, 2007 2:52 am Post subject: |
|
|
Thanks, TyRaNiD.
I am writting a prx and I want it to create a button event which effect the game I playing or VSH but not the prx itself.
I just have a look at your remotejoy attached in PSPLINK, and I know how to do that, thanks again? |
|
| Back to top |
|
 |
|
|
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
|