HI, i tried to wrote this code to prove me that KeyPress::isKeyCurrentlyDown never return true and effectively it doesn’t:
void timerCallback() override
{
if (!KeyPress::isKeyCurrentlyDown(KeyPress::spaceKey))
{
DBG("notPressed");
}
}
My app has no a main window, it’s thought to show a little component near mouse position every time I press a key, but everywhere I put something like KeyPress::isKeyCurrentlyDown it’s never recognized that the key is pressed, even if I press it (I tried with a lot of keys to debug), initially I thought that it should be because I put it in a class that doesn’t inherit Component but even put it in a Component class (that is visible on screen) it doesn’t work.
I know that there are virtual methods in Component to listen whenever a key or a modifier is pressed, but for my app structure I can’t use them (actually I as I said I don’t have a component on screen for my app, is a background app).