Device buttons


Hi. I'm really liking Juce so far; nice clean API, great docs. Awesome!


Is there any way to have Juce respond to Android device buttons - e.g. Back, Menu? I've searched a few times, but haven't found anything so far. Possibly I'm just using the wrong keywords :)


Any help greatly appreciated!


I'm totally new to Android dev, but perhaps KeyPressed() might return somthing useful? Otherwise you'll probably need to do this on the JAVA side.


This has been on my to-do-list.. I was rather hoping that someone using android would give me a helpful snippet that points me in the right direction... :)


Thanks guys.


I'll try Rory's suggestion, and see if I get anything from keyPressed. That would certainly be a sensible way for the device to report it, but I suspect Android might not be that sensible :) Otherwise I'll take a look around the Android docs and post here again if I find anything useful. If it does involve Java, my motivation to get it working may diminish somewhat ;)


Thanks again


I hear you. I'm currently pirouetting around JAVA obstacles like Nijinsky. I fear I've run out of stage however. Crash, thump, wallop. 


Btw, have you looked at this:

Might be of some help to you?


Fantastic, thanks Rory. I'll take a look.


How is the device buttons comming along? It's been a year so it might be done already for what I know.


Don't think we've got anything new, but Android is a big priority for us now, so I'll make sure this is in our backlog!


For support the back button of Android, my nasty solution is:

bool ComponentForSomething::keyPressed (const KeyPress& key)
    if (key == KeyPress::escapeKey)
        // ... make it disvisible, show pervious component,
        // deliver the escapeKey to parent component or something else

        return true;
    return Component::keyPressed (key);


I've been wondering how to get the back button working for Android... will try your escape key method, thanks


Is it that easy? Thank you, the back button is kind of important.


Glad to hear about the Android future, thanks


As Jules already said, this is in our backlog and we will implement it as soon as we have time.