Added keyboard support for MAC

Refers to #1323.