Gerry, Dezsoe,
I may have an idea what is going on.
Gerry, the 'template' plugin sub for a 'button press_event' makes use of the boolean variable 'OnScreen', and conditionally only does something if 'OnScreen' is true.
I was playing around and found that when a plugin sends a button press, 'Onscreen is false'. Do you still have a check based on the template that requires 'Onscreen' to be true? I did, and if you take that away or make the plugin do something if it is 'false', then the plugin will respond to the xbox control sending a button press of any number. Hope that is it, and it is easy fix for you.
The Template code:
- Code: Select all
Public Sub Buttonpress_event(ByVal ButtonNumber As Integer, ByVal OnScreen As Boolean)
If OnScreen Then
UC.AddStatusmessage("Onscreen Button#: " & ButtonNumber)
MessageBox.Show("onscreen button #: " & ButtonNumber)
'If ButtonNumber = 128 Then
' ' Code...
'End If
End If
End Sub
Changed so a Plugin will respond to another plugin pushing the button:
- Code: Select all
Public Sub Buttonpress_event(ByVal ButtonNumber As Integer, ByVal OnScreen As Boolean)
If OnScreen Then
UC.AddStatusmessage("Onscreen Button#: " & ButtonNumber)
MessageBox.Show("onscreen button #: " & ButtonNumber)
'If ButtonNumber = 128 Then
' ' Code...
'End If
Else ' <------- Plugin will only do something from an 'onscreen=false' event caused by other plugin.
UC.AddStatusmessage("Offscreen Button#: " & ButtonNumber)
MessageBox.Show("Offscreen Button#: " & ButtonNumber)
End If
End Sub
regards
Eric