Enhance handling mouse key events for buttons