title: I can't make working keyCallback function in OpenGL and glfw
body: <pre class="lang-py prettyprint-override"><code>import glfw
  from OpenGL.GL import *
  import numpy as np
  
  currentMode = GL_LINE_LOOP
  
  def render(currentMode):
  
  
  def key_callback(window, key, scancode, action, mods):
      if key==glfw.KEY_1:
          if action==glfw.PRESS:
              currentMode = GL_POINTS
      elif key==glfw.KEY_2:
          if action==glfw.PRESS:
              currentMode = GL_LINES
      elif key==glfw.KEY_3:
          if action==glfw.PRESS:
              currentMode = GL_LINE_STRIP
  
  while not glfw.window_should_close(window):
      glfw.poll_events()
      render(currentMode)
      glfw.swap_buffers(window)
      print(currentMode)
  glfw.terminate()
  </code></pre>
  
  <p>I try to change primitive type to use render function's parameter. 
  But, It doesn't work. 
  What should I do?</p>