# Get the key event after losing focus

**URL:** https://discourse.processing.org/t/get-the-key-event-after-losing-focus/28633
**Category:** Coding Questions
**Created:** [March 18, 2021, 5:39am UTC](https://discourse.processing.org/t/get-the-key-event-after-losing-focus/28633 "2021-03-18T05:39:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![AbleYudada](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/ableyudada/32/14190_2.png) [@AbleYudada](https://discourse.processing.org/u/AbleYudada)
#### Post date: [March 18, 2021, 5:39am UTC](https://discourse.processing.org/t/get-the-key-event-after-losing-focus/28633/1 "2021-03-18T05:39:32Z")

</div>

Hello guys！

I want to implement a feature that I can still get key events when the focus is not on the current window, but I am having trouble now. I found an example on github, but I put the java code and jar file into my project file but it still doesn’t work. I have the following error report, I hope everyone can help me

> **[mayoneko/p5nativehook](https://github.com/mayoneko/p5nativehook)**
>
> Global keyboard and mouse listeners for Processing

No library found for org.jnativehook  
No library found for org.jnativehook.dispatcher  
No library found for org.jnativehook.mouse  
No library found for p5nativehook  
Libraries must be installed in a folder named ‘libraries’ inside the sketchbook folder (see the Preferences window).  
The package “org.jnativehook” does not exist. You might be missing a library.

---

<div class="post-metadata">

### Author: ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)
#### Post date: [March 18, 2021, 10:16am UTC](https://discourse.processing.org/t/get-the-key-event-after-losing-focus/28633/2 "2021-03-18T10:16:28Z")

</div>

Can you share the file/folder structure, basically how you installed the library? Is it in the libraries folder or in the sketch folder?

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [March 18, 2021, 10:34am UTC](https://discourse.processing.org/t/get-the-key-event-after-losing-focus/28633/3 "2021-03-18T10:34:40Z")

</div>

Sometimes it helps when you drag the jar-file  
of the library onto the processing IDE Editor Window

No joke.
