Added use of onButton* events

Might need some fixing but works for now