# Get key pressed inside update loop?

**URL:** https://discourse.libcinder.org/t/get-key-pressed-inside-update-loop/1865
**Category:** Using Cinder
**Created:** [September 1, 2021, 11:04pm UTC](https://discourse.libcinder.org/t/get-key-pressed-inside-update-loop/1865 "2021-09-01T23:04:59Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Mango](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Mango](https://discourse.libcinder.org/u/Mango)
#### Post date: [September 1, 2021, 11:04pm UTC](https://discourse.libcinder.org/t/get-key-pressed-inside-update-loop/1865/1 "2021-09-01T23:04:59Z")

</div>

Hi,

I would like to get the key pressed status inside the `update()` loop, rather than overriding the `keyDown()` function. Is this possible? Reasons for this is because the keyDown is too slow in giving me updates about key status, and I need it to be sampled as fast as the update loop (otherwise everything looks sluggish)

Thanks

---

<div class="post-metadata">

### Author: ![Mango](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Mango](https://discourse.libcinder.org/u/Mango)
#### Post date: [September 3, 2021, 5:07pm UTC](https://discourse.libcinder.org/t/get-key-pressed-inside-update-loop/1865/2 "2021-09-03T17:07:29Z")

</div>

I have found a workaround to this using imgui, but now having issues with key released.

---

<div class="post-metadata">

### Author: ![felixfaire](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/felixfaire/32/168_2.png) [@felixfaire](https://discourse.libcinder.org/u/felixfaire)
#### Post date: [September 6, 2021, 9:07am UTC](https://discourse.libcinder.org/t/get-key-pressed-inside-update-loop/1865/3 "2021-09-06T09:07:12Z")

</div>

This seems surprising, the keyDown callbacks should happen instantly (part of the reason they are separated from the update loop is to be faster than 60hz i imagine). Do you have some more information to share about what is appearing too slow and your target platform etc?

---

<div class="post-metadata">

### Author: ![Mango](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Mango](https://discourse.libcinder.org/u/Mango)
#### Post date: [September 17, 2021, 5:38pm UTC](https://discourse.libcinder.org/t/get-key-pressed-inside-update-loop/1865/4 "2021-09-17T17:38:37Z")

</div>

There seems to be a bug in Cinder on unix, which has been there for well over a year and hasn’t been fixed : [https://github.com/cinder/Cinder/issues/2226](https://github.com/cinder/Cinder/issues/2226) . I managed to overcome the issue in the original post (by leveraging ImGui’s integration), but i stopped using cinder partly because the `keyUp` function is broken (at least on some distros like arch) [https://github.com/cinder/Cinder/issues/2251](https://github.com/cinder/Cinder/issues/2251). I have tested a branch from Feb 2020 and it had the same issues, and it still persists in the current branch (maybe an issue with SDL so not sure tbh)
