diff --git a/pixelgl/input.go b/pixelgl/input.go
index 6668ec5ba2d96b4b3f60a0e0604a16c549e1728b..236762897b349be8ef946b801a8b4721e8bba8c6 100644
--- a/pixelgl/input.go
+++ b/pixelgl/input.go
@@ -329,6 +329,9 @@ func (w *Window) initInput() {
 		})
 
 		w.window.SetKeyCallback(func(_ *glfw.Window, key glfw.Key, scancode int, action glfw.Action, mods glfw.ModifierKey) {
+			if key == glfw.KeyUnknown {
+				return
+			}
 			switch action {
 			case glfw.Press:
 				w.currInp.buttons[Button(key)] = true