Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local udp = socket.udp()
- udp:setsockname('127.0.0.1', 5000)
- udp:settimeout(0.001)
- local char, ip, port
- timer.performWithDelay(200, function ()
- char, ip, port = udp:receivefrom()
- if char then
- local scene = storyboard.getScene(storyboard.getCurrentSceneName())
- if type(scene.keyboardPressed) == 'function' then
- scene:keyboardPressed(char)
- end
- end
- end, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement