I think that I’ve made some progress in adapting my key-mapping class to use Panda’s extended input-device support. However, I’ve hit another stumbling block:
In order to determine which devices I should attach, I want to store the device-type associated with each key-mapped game-control. The problem is that of how to find that device-type when binding keys.
I’m using “ButtonThrower.setButtonDownEvent” and “ButtonThrower.setButtonUpEvent” to detect player inputs when binding a key. This works well enough–but its callback provides only a string key-name, as far as I’ve found. I see no way to provide any additional arguments (so that I might pass in the device-type), and it doesn’t seem to include the prefix given when calling “attachInputDevice” (so that I might parse the device-type out of the string). Thus I’m not sure of how to determine the device-type of the button that was pressed.
Any thoughts on how I might deal with this?