Hardware keyboard support (Windows support + Mac fix)

Added Windows support for HW keyboard ( as addition https://github.com/cocos2d/cocos2d-x/pull/2704 ) and also included fix for Mac.