Creat a button event.

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

Moderators: cheriff, TyRaNiD

Post Reply
poison
Posts: 17
Joined: Thu Dec 14, 2006 11:07 pm

Creat a button event.

Post by poison »

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
/**
* 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?
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

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
poison
Posts: 17
Joined: Thu Dec 14, 2006 11:07 pm

Post by poison »

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