Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have code that renders a triangle using OpenGL. I would like to control it using the arrow keys on the keyboard.

Anyone know how I would do this on OSX? I think I can create an Objective-C file and import NSEvent, however, I was looking to try this without the need for ObjC. I would also like to avoid SDL.

share|improve this question
Whatever OpenGL context-providing API you're using should come with input-handling features already. At least the good ones do, but I don't know much about what's available on OSX (isn't pretty much everything?). So maybe look up its documentation? –  madshogo May 24 '13 at 20:02
What do you use to create the window? Whatever it is (GLUT?), it probably comes with input handling. –  Adam S May 25 '13 at 2:21
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.