kivy 1.9.0
来自kivy.app import App
来自kivy.uix.floatlayout导入FloatLayout
来自kivy.uix.boxlayout导入BoxLayout
来自kivy.uix.button导入按钮
来自kivy.uix.gridlayout import GridLayout
来自kivy.uix.widget导入Widget
来自kivy.lang import Builder
来自simpleOSC import initOSCClient,initOSCServer,closeOSC,\ setOSCHandler,sendOSCMsg
class OscShowcase(BoxLayout):
pass
class TestOscApp(App):
def build(self):
return OscShowcase()
def send_Osc(self, *l):
#pass
sendOSCMsg('activate', [3.0])
如果 name ==' main ':
host = '127.0.0.1'
sport = 9000
rport = 9001
# osc
initOSCClient(host, sport)
initOSCServer(host, rport)
TestOscApp().run()
.kv文件如下
:
BoxLayout:
Widget:
Button:
text: 'OSC'
pos: (500, 400)
on_press: app.send_Osc()
你认为我可以直接在kv.file中编辑OSC消息,以便用指定的osc消息分隔每个按钮吗?