Update main.cpp

Minor change in your keyboard function to allow compilation on Mac OS X