Jump to content
sleirsgoevy

Not all keys send key events

Recommended Posts

So I can display stuff on the screen and start playlists, however the Xlet only receives events for 6 of 11 buttons (directional buttons, "Enter", and "Menu"). The other buttons either operate directly on the video being played, or just don't work if I don't start a video.

Share this post


Link to post
Share on other sites

The L1, L2, R1 and R2 buttons work as NEXT TRACK, PREVIOUS TRACK, FAST FORWARD and REWIND.
But an Xlet can capture those buttons too.

 

You just need two steps:

 

First:

 

The BDJO file 00000.bdjo in the BDJO folder contains a lot of attributes relating to the JAR file.
The HD Cookbook project contains a jar app you can use to convert the BDJO file into an XML file for editing, and convert back again.

https://github.com/oliverlietz/bd-j/tree/master/DiscCreationTools/net.java.bd.tools.bdjo

 

    java -jar bdjo.jar 00000.bdjo 00000.xml

 

Edit the XML in your favorite text editor. Look for a tag named keyInterestTable. For "The UFO Game!" it looks like this:

 

    <keyInterestTable>0xffe00000</keyInterestTable>

 

This value indicates which buttons the Xlet should be able to use.

 

    PLAY = 0x80000000;
    STOP = 0x40000000;
    FAST_FWD = 0x20000000;
    REWIND = 0x10000000;
    TRACK_NEXT = 0x08000000;
    TRACK_PREV = 0x04000000;
    PAUSE = 0x02000000;
    STILL_OFF = 0x01000000;
    SECONDARY_AUDIO_ENABLE_DISABLE = 0x00800000;
    SECONDARY_VIDEO_ENABLE_DISABLE = 0x00400000;
    PG_TEXTST_ENABLE_DISABLE = 0x00200000;

 

Add them all up, and you get 0xffe00000.

Save and convert the XML back to a BDJO file:

 

    java -jar bdjo.jar 00000.xml 00000.bdjo

 

Here's a bdjo file from the Minimal SDK where I changed the value for you. https://www.blu-play.com/00000.bdjo

 

Then:

 

In your Xlet code, you need to create a UserEventRepository, and add keys you want to use.

 

    org.dvb.event.UserEventRepository rep = new org.dvb.event.UserEventRepository("SomeNameForYourRepository-DoesntReallyMatterWhat");
    rep.addAllArrowKeys(); // All dpad buttons
    rep.addKey(org.havi.ui.event.HRcEvent.VK_ENTER); // Cross
    rep.addKey(org.bluray.ui.event.HRcEvent.VK_POPUP_MENU); // Square
    rep.addKey(org.bluray.ui.event.HRcEvent.VK_PAUSE); // Circle (but only works with Dualshock 4)
    rep.addKey(org.bluray.ui.event.HRcEvent.VK_TRACK_NEXT); // R1
    rep.addKey(org.bluray.ui.event.HRcEvent.VK_TRACK_PREV); // L1
    rep.addKey(org.bluray.ui.event.HRcEvent.VK_FAST_FWD); // R2
    rep.addKey(org.bluray.ui.event.HRcEvent.VK_REWIND); // L2
    org.dvb.event.EventManager.getInstance().addUserEventListener(this, rep);

 

Now you should be able to receive these buttons in your Xlet.

 

Share this post


Link to post
Share on other sites

I've already figured it out. I've found a message on markmail.org that suggests just that, however it also suggests changing the title's playback type in index.bdmv to BDJPlayback_INTERACTIVE.

Anyway, thank you for help. It is working now.

Share this post


Link to post
Share on other sites
Just now, sleirsgoevy said:

I've already figured it out. I've found a message on markmail.org that suggests just that, however it also suggests changing the title's playback type in index.bdmv to BDJPlayback_INTERACTIVE.

Anyway, thank you for help. It is working now.

 

Yea, there's lots of useful help at that archived markmail forum. 🙂

 

Looking forward to see what you're brewing. 😎

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...