For whatever reason I can't seem to reply to this post with code. Don't know wtf is going on.
onChange is meant to be used as a notification that arrives when something changes, so if you wanted to have something like a sound that plays when you type, you'd set onChange to be your function.