Device buttons


#1

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!


#2

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.


#3

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... :)


#4

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


#5

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


#6

Btw, have you looked at this:

http://www.juce.com/forum/topic/android-dpi-bug?page=1

Might be of some help to you?


#7

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


#8

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


#9

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!


#10

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);
}


#11

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


#12

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


#13

Glad to hear about the Android future, thanks


#14

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