TUIO input provider implementation — Kivy v1.0.1-dev documentation

# TUIO input provider implementation

class `kivy.input.providers.tuio.` `TuioMotionEventProvider`(device, args)

  Bases: `kivy.input.provider.MotionEventProvider`

  Tuio provider listen to a socket, and handle part of OSC message

  > - /tuio/2Dcur
  > - /tuio/2Dobj

  Tuio provider can be configured with the [`input]` configuration

      [input]
      # name = tuio,<ip>:<port>
      multitouchtable = tuio,192.168.0.1:3333

  You can easily handle new tuio path by extending the providers like this

      # Create a class to handle the new touch type
      class TuioNEWPATHMotionEvent(MotionEvent):
          def __init__(self, id, args):
              super(TuioNEWPATHMotionEvent, self).__init__(id, args)

          def depack(self, args):
              # Write here the depack function of args.
              # for a simple x, y, value, you can do this :
              if len(args) == 2:
                  self.sx, self.sy = args
                  self.profile = ('pos', )
              self.sy = 1 - self.sy
              super(TuioNEWPATHMotionEvent, self).depack(args)

      # Register it to tuio touch provider
      TuioMotionEventProvider.register('/tuio/PATH', TuioNEWPATHMotionEvent)

  static `create`(oscpath, **kwargs)

    Create a touch from a tuio path

  static `register`(oscpath, classname)

    Register a new path to handle in tuio provider

  `start`()

    Start the tuio provider

  `stop`()

    Stop the tuio provider

  static `unregister`(oscpath, classname)

    Unregister a new path to handle in tuio provider

  `update`(dispatch_fn)

    Update the tuio provider (pop event from the queue)

class `kivy.input.providers.tuio.` `Tuio2dCurMotionEvent`(device, id, args)

  Bases: `kivy.input.providers.tuio.TuioMotionEvent`

  A 2dCur TUIO touch.

class `kivy.input.providers.tuio.` `Tuio2dObjMotionEvent`(device, id, args)

  Bases: `kivy.input.providers.tuio.TuioMotionEvent`

  A 2dObj TUIO object.