Alternate Input System


11-12-2005 19:47:39

I'm working on a Python wrapper for OIS
I have a working prototype and I would love to get your feedback on it.
It has a drop-in replacement for and seems to work just fine.

Here is a Python23 module, if you need a Python24 module you will have to build it yourself from the oisaddons/python CVS module at the above mentioned URL.


11-12-2005 22:54:21

That's really nice. After working with the ogre event system I'm about fed up with dealing with it. Do you mind if I include your SampleFramework (with modifications) in pyogre?

Does this system allow for event callbacks? Such as something.onKeyDown(...)?


11-12-2005 23:14:18

Of course, you are welcome to include it.
There is a callback system that I implemented after reading a post here by you. There is essentially one class that handles the delegation of events to registered Python functions. No directors.
Here is a small sample:
import ois
import time

def onMouseMoved(arg):
print 'Mouse X: %d' % arg.state.absX
print 'Mouse Y: %d' % arg.state.absY
return True

def onMousePressed(arg, id):
print 'Mouse pressed: %d' % id
return True

# A window handle must be aquired, but is skipped for this demonstration

inputSystem = ois.InputManager.createInputSystem(params)
mouse = inputSystem.createInputObject(ois.OISMouse, True)

ois.getEventListener().addListener('mouseMoved', onMouseMoved)
ois.getEventListener().addListener('mousePressed', onMousePressed)

while True:

You should look at to see how it works.

Also I had to create an int* wrapper to be able to call RenderWindow.getCustomAttribute
hadle = ois.IntPtr()
self.renderWindow.getCustomAttribute("HWND", handle)
hwnd = handle.value()


11-12-2005 23:52:22

I didn't notice the getCustomAttribute in RenderTarget. I'll add this to my todo list.


12-06-2006 22:09:17

What's the current status of the pyOIOS bindings. It appears that the wrappers for pyOIS won't compile with OIS0.70 and there's some confusion on it's status:


12-06-2006 22:58:51

I haven't had a chance to look at it in some time, but I have been planning to update it and integrate it better with PyOgre.


13-06-2006 09:27:57

OK thanks for the feedback.