paulscode
New member
I am customizing the input plug-in (based on Input-SDL source), and trying to figure out where to interface the Rumble Pak. It looks like the correct function is in ControllerCommand, so that's where I'm starting. From there, it looks like I need to be under:
From there (starting to be less certain at this point) it looks like I then need to be under:
I created two interface functions, for starting and stopping the rumble effect. Based on how the linux joystick rumble is hooked up, I came up with the following:
However, it doesn't look like this code is ever running. I'm thinking the problem is that the condition "->Plugin == PLUGIN_RAW" is the problem. Any thoughts on how to correct this? I could try removing the conditional statement (it's also used earlier in the code under "case RD_READPAK:"), but I'm not sure if this would create other problems. Thought I'd ask here to see what is the "proper" way to do this before I start screwing around with it.
Code:
switch( Command[2] )
{
...
case RD_WRITEPAK:
From there (starting to be less certain at this point) it looks like I then need to be under:
Code:
if (controller[Control].control->Plugin == PLUGIN_RAW)
{
...
I created two interface functions, for starting and stopping the rumble effect. Based on how the linux joystick rumble is hooked up, I came up with the following:
Code:
#ifdef ANDROID
if( dwAddress == PAK_IO_RUMBLE )
{
if( *Data )
{
DebugMessage( M64MSG_INFO, "Android, activating device vibrator" );
Android_JNI_Vibrate( 1 );
}
else
{
DebugMessage( M64MSG_INFO, "Android, deactivating device vibrator" );
Android_JNI_Vibrate( 0 );
}
}
#endif
However, it doesn't look like this code is ever running. I'm thinking the problem is that the condition "->Plugin == PLUGIN_RAW" is the problem. Any thoughts on how to correct this? I could try removing the conditional statement (it's also used earlier in the code under "case RD_READPAK:"), but I'm not sure if this would create other problems. Thought I'd ask here to see what is the "proper" way to do this before I start screwing around with it.