No, it will run regardless of which application has the focus. The downside of this is that it's not accurate, and that it uses a lot of resources by looping roughly 200 times per key press, and writing it to a file.