# GLFW not registering release events

**URL:** <https://discourse.glfw.org/t/glfw-not-registering-release-events/2902>\
**Category:** support\
**Created:** [March 26, 2025, 3:04pm UTC](https://discourse.glfw.org/t/glfw-not-registering-release-events/2902 "2025-03-26T15:04:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pioyi](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@pioyi](https://discourse.glfw.org/u/pioyi)\
**Post date:** [March 26, 2025, 3:04pm UTC](https://discourse.glfw.org/t/glfw-not-registering-release-events/2902/1 "2025-03-26T15:04:40Z")

</div>

I’ve got a graphical program that receives input from `dmenu`. When trying to collect an answer from the user, I create a pipe via `popen` so that I can re-direct the command’s standard output to my program.

The forking and unfocusing formed by the pipe creating a separate dmenu window seems to confuse GLFW. So, if Ctrl-W triggers the original `popen` call, neither the control nor the w keys will ever be registered as released when the pipe gets closed and dmenu terminates. GLFW behaves like they’re still being pressed and it only marks them as released if I press and release each individual key again. Is there any way in forcing a key to be released, without having to create a key manager and state abstraction on top of GLFW? Please don’t criticize my use of `popen`, I know it’s weird! Basically, I’m looking for a way to manually mark keys as released, whenever I want.

Thank you! And thanks to all contributors creating such a wonderful and lightweight library

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [March 26, 2025, 4:23pm UTC](https://discourse.glfw.org/t/glfw-not-registering-release-events/2902/2 "2025-03-26T16:23:39Z")

</div>

This is advanced use and beyond the design of GLFWs API, so you’ll likely need to either alter GLFW or try a workaround.

GLFW resets the keyboard state when the application looses keyboard focus. So one workaround might be to do something to loose the window focus, for example create a new small temporary window, perhaps saying “Connecting to dmenu”.
