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 

Creat a button event.

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



Joined: 14 Dec 2006
Posts: 17

PostPosted: Wed Apr 11, 2007 5:15 pm    Post subject: Creat a button event. Reply with quote

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
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Thu Apr 12, 2007 2:23 am    Post subject: Reply with quote

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
View user's profile Send private message
poison



Joined: 14 Dec 2006
Posts: 17

PostPosted: Thu Apr 12, 2007 2:52 am    Post subject: Reply with quote

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
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