PhysicalFlick
https://github.com/junya28nya/PhysicalFlick

トグル入力(development/K-tai)用のソースもあるので、参考になるかも