OIS un-buffered joystick problem


29-01-2009 12:57:46

hi all,

seems to be some sort of problem accessing the joystick state when using un-buffered joystick input.

state = self.Joy.getJoyStickState()
self.rotationX = ogre.Degree( -state.mAxes[3].abs )
self.rotationY = ogre.Degree( -state.mAxes[2].abs )

above works fine but I cannot access the button data:

print state.mButtons[0]
TypeError: No to_python (by-value) converter found for C++ type: class std::_Vb_reference<unsigned int,int,class std::vector<bool,class std::allocator<bool> > >

JoyStickState.mButtons is defined as type ogre.io.OIS._ois_._Bvector, which looks to me like its not properly exposed?

I can use buffered joystick instead, as the buttonPressed function on JoyStickListener takes 2 arguments, one of which is an int specifying which button is pressed. Just unbuffered is nicer for dealing with joypad sticks.

any help much appreciated as always :)


30-01-2009 13:44:14

Thanks for finding this -- it's now fixed in the SVN however usage is a little 'strange' :)

val = state.mButtons[0].__int__()



30-01-2009 14:18:27

Cool, thanks for fixing!

yes that is indeed a bit strange ;)