Repository: PistonDevelopers/glfw-rs (language: rust)

Issue:
Events don’t seem to work
The following code is a no-op when hitting Esc:

```
extern crate glfw;

use glfw::{Action, Context, Key};

fn main() {
   let mut glfw = glfw::init(glfw::FAIL_ON_ERRORS).unwrap();

    // Create a windowed mode window and its OpenGL context
    let (mut window, events) = glfw.create_window(300, 300, "Hello this is window", glfw::WindowMode::Windowed)
        .expect("Failed to create GLFW window.");

    // Make the window's context current
    window.make_current();

    // Loop until the user closes the window
    while !window.should_close() {
        // Swap front and back buffers
        window.swap_buffers();

        // Poll for and process events
        glfw.poll_events();
        for (_, event) in glfw::flush_messages(&events) {
            println!("{:?}", event);
            match event {
                glfw::WindowEvent::Key(Key::Escape, _, Action::Press, _) => {
                    window.set_should_close(true)
                },
                _ => {},
            }
        }
    }
}
```

Taken from the official documentation. I don’t see no time when we enter the `for`… :/



Discussion / hints:

Fix patch:
diff --git a/src/lib.rs b/src/lib.rs
index 463b7760..ced7b00c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -38,6 +38,7 @@
 //!
 //!     // Make the window's context current
 //!     window.make_current();
+//!     window.set_key_polling(true);
 //!
 //!     // Loop until the user closes the window
 //!     while !window.should_close() {


Test patch: