getch() implementation for osx/unix