Most of this is copied from @rougier's lib:

https://github.com/rougier/pyglfw/blob/master/glfw.py

@rougier I made a couple minor changes -- can you run a diff between our versions and see what you think?