some code to handler the iphone and ipad keyboard event