buffered input and api source code [solved]


14-08-2007 21:02:36


I'm just trying to use buffered input with OIS. As far as the Tutorial 05 (Buffered Input) is concerned: that is not really buffered input, is it?

Neither does it implement an OIS event listener (not even talking about registering it) nor do keyPressed etc get an OIS event. Moreover, buffered key input is disabled by default in the sample framework: def __init__(self, renderWindow, camera, bufferedKeys = False, bufferedMouse = True, bufferedJoy = False):

This is no bashing by no means, just a question, because it's really confusing.

This leads to a second question: is there a way to have a look at the Python code to extract from the API how things work? I tried to follow the C++ buffered input tutorial in the main wiki: self.keyboard = self.inputManager.createInputObjectKeyboard(ois.OISKeyboard, True) # True == buffered

and got this exception: self.keyboard.setEventCallback(self)
Boost.Python.ArgumentError: Python argument types in
Keyboard.setEventCallback(Keyboard, PinaInput)
did not match C++ signature:
setEventCallback(Keyboard_wrapper {lvalue}, OIS::KeyListener* keyListener)
setEventCallback(OIS::Keyboard {lvalue}, OIS::KeyListener* keyListener)

PinaInput inherits from ois.KeyListener. Looks right to me although it doesn't work. I would like to look up the correct usage somewhere, but didn't find anything.

Thanks in advance,


15-08-2007 04:39:03

Simply put the tutorials have not all been updated (I think only 1-4 are complete)...

You can look at the help that's included in with Python-Ogre for the API specs (unfortunately it's built from the underlying C++ source so varies dramatically in it's usefullness).. Use the search functionality as the 'menu' is terrible (something I haven't yet learnt to fix)..

Your problem might be that with Python you not only have to 'inherit' from the parent class but also 'init' it as part of your class creation. i.e.
class InputManager(OIS.KeyListener, OIS.MouseListener):
def __init__(self, app, hnd):

Also look at Demo_Spinner for an example of this..



15-08-2007 12:24:59

The help file is basically what I get in Eclipse if I don't err, thus no additional help. Nevertheless, thanks for providing it.

The problem was indeed the missing __init__() calls. Did not know this.

I will have a look at the spinner demo.