handle key and cmd events on Android