Skip to main content

addAllNumericKeys

7 replies [Last post]
hooligancat
Offline
Joined: 2009-10-20
Points: 0

I can't seem to get any of the numeric keys to fire an event, every other button fires correctly. Code snippett:

import org.dvb.event.EventManager;
import org.dvb.event.UserEvent;
import org.dvb.event.UserEventListener;
import org.dvb.event.UserEventRepository;
import org.bluray.ui.event.HRcEvent;

public class xxx implements ControllerListener, MouseMotionListener, MouseListener, UserEventListener

UserEventRepository userEventRepository = new UserEventRepository("Blu-ray events");
userEventRepository.addAllArrowKeys();
userEventRepository.addAllColourKeys();
userEventRepository.addAllNumericKeys();

userEventRepository.addKey(HRcEvent.VK_ENTER);
userEventRepository.addKey(HRcEvent.VK_POPUP_MENU);
userEventRepository.addKey(HRcEvent.VK_PLAY);
userEventRepository.addKey(HRcEvent.VK_PAUSE);
userEventRepository.addKey(HRcEvent.VK_TRACK_NEXT);
userEventRepository.addKey(HRcEvent.VK_TRACK_PREV);

EventManager.getInstance().addUserEventListener(this, userEventRepository);

public void userEventReceived(UserEvent e)
{
if (e.getType() == HRcEvent.KEY_PRESSED)
{
switch (e.getCode())
{
case HRcEvent.VK_0:
case HRcEvent.VK_1:
case HRcEvent.VK_2:
case HRcEvent.VK_3:
case HRcEvent.VK_4:
case HRcEvent.VK_5:
case HRcEvent.VK_6:
case HRcEvent.VK_7:
case HRcEvent.VK_8:
case HRcEvent.VK_9:
numberKeyPressed(e.getCode() - HRcEvent.VK_0);
...
...

Everything except the number keys fire correctly. The Title is in Interactive mode, and I can't see any key events to register in the BDJO file that pertain to the number keys.

The cookbook appears to handle the number keys identically.

Is there anything special that is required?

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vinaykagarwal
Offline
Joined: 2006-01-14
Points: 0

If you can make TMT show the remote control (it is a bit tricky), then mouse click on the numeric keys does give the appropriate event.

hooligancat
Offline
Joined: 2009-10-20
Points: 0

Joe, you led me on the right track.

There is an option in the right click menu which is Keyboard Shortcuts Enabled toggled with Ctrl-Z, which is enabled by default every time the player is started. When enabled, numeric keys do not work either from keyboard or sub control panel. When disabled the number keys work on the sub panel. This setting does not seem to affect any other control.

I must conclude this is a bug in the software. Surely keyboard shortcuts would allow 0-9 on the keyboard to work in addition to the sub panel. ie the sub panel should work in either case.

Thanks for your help everyone.

vinaykagarwal
Offline
Joined: 2006-01-14
Points: 0

I simply use org.dvb.event.OverallRepository that already has all keys added. If you use that, instead of this code

UserEventRepository userEventRepository = new UserEventRepository("Blu-ray events");
userEventRepository.addAllArrowKeys();
userEventRepository.addAllColourKeys();
userEventRepository.addAllNumericKeys();
userEventRepository.addKey(HRcEvent.VK_ENTER);
userEventRepository.addKey(HRcEvent.VK_POPUP_MENU);
userEventRepository.addKey(HRcEvent.VK_PLAY);
userEventRepository.addKey(HRcEvent.VK_PAUSE);
userEventRepository.addKey(HRcEvent.VK_TRACK_NEXT);
userEventRepository.addKey(HRcEvent.VK_TRACK_PREV);
EventManager.getInstance().addUserEventListener(this, userEventRepository);

you use, this code

EventManager.getInstance().addUserEventListener(this, new OverallRepository());

And I can see events from all keys including numeric keys.

hooligancat
Offline
Joined: 2009-10-20
Points: 0

hmm That didn't work either.

I wonder if this is a bug with TMT, I haven't tried it on the PS3 yet.

vinaykagarwal
Offline
Joined: 2006-01-14
Points: 0

I have not been able to get numeric, play/pause/stop/fast forward/rewind etc keys working with TMT. Interestingly, the letter keys work.

Joe Rice

IIRC, in a recent version ArcSoft added the need to tell the player
application to pass some key events to the BD-J app; otherwise they
get consumed by the player application. I want to say ctrl-k toggles
this, but I don't recall for sure. I think there's an option for it in
the contextual menu that's displayed when right-clicking on the main
window.

Will try and remember to look at it when I'm back around a machine
with TMT.

Joe

On Nov 21, 2009, at 11:27, bd-j-dev@mobileandembedded.org wrote:

> I have not been able to get numeric, play/pause/stop/fast forward/
> rewind etc keys working with TMT. Interestingly, the letter keys work.
> [Message sent by forum member 'vinaykagarwal' ]
>
> http://forums.java.net/jive/thread.jspa?messageID=372814
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
> For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

hooligancat
Offline
Joined: 2009-10-20
Points: 0

Any suggestions?