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