Update main.cpp

Minor change in your keyboard function to allow compilation on Mac OS X
Merge pull request #1 from bestimmaa/patch-1

updated keyboard function to work on mac