org.havi.ui.event.HRcEvent.KEY_RELEASED is triggered at roughly the same time as org.havi.ui.event.HRcEvent.KEY_PRESSED
It should wait calling userEventReceived(org.dvb.event.UserEvent event) in org.dvb.event.UserEventListener till the key is actually released... (obviously).
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
No child items are currently assigned. Use child items to break down this issue into smaller parts.
KEY_PRESSED, KEY_TYPED and KEY_RELEASED are all called right after each other. These should be split up. KEY_RELEASED should only be called when a key is actually released.
I'm stuck with my current BD-J game project until this is resolved.
API would be easy to extend so that application could provide (optionally) KEY_PRESSED, KEY_TYPED and KEY_RELEASED events/flags. This of course wouldn't solve the problem unless also applications are changed. The problem is such information is not easily available (ex. in VLC), it would require changes to several layers in applications.
I don't know how well re-generating the sequence from incoming key presses would work. I'm thinking something like triggering KEY_TYPED after some delay (and if the key is repeated within the delay), and KEY_RELEASED when the same key event does not occur again within the delay.
It is true that VLC (and other applications) also needs to be adapted yes. As far as I understand, VLC calls bd_user_input(BLURAY *bd, int64_t pts, uint32_t key) from bluray.c
One relative quick fix could be to change that unsigned int to a signed int. If higher than 0 then the key is pressed. If lower than 0 then the key is released. I.e. KEY 37 = left arrow pressed. KEY -37 = left arrow is released. Wouldn't require nearly as many changes as other solutions might need.
It is important that several KEY_PRESSED events can be called without KEY_RELEASED being called before each key is actually released. Like in this sequence:
Press arrow left => KEY_PRESSED 37
Press arrow up => KEY_PRESSED 38
Release arrow left => KEY_RELEASED 37 (and possibly KEY_TYPED 37)
Release arrow up => KEY_RELEASED 38 (and possibly KEY_TYPED 38)
Several keys can be pressed before KEY_RELEASED is called on them. (Only limited by hardware).
Initial support is in git now. Next, we need to get some player to support this so that we can see if it is enough and really works ...
@MisthaLu : I also added support for AWT mouse events (tested with 8bitMemoirs-Issue1-English.iso). Do you know any other discs that could be used for testing ?
No, I don't know of any other BD-J project that uses mouse. I don't think mouse is used a lot, although guidelines does encourage devs to add mouse support for future players.
Here are some quotes from the HD Cookbook project:
Page 15-14: "It is a good idea to write applications so that they respond to a mouse or keyboard, if/when present, but it is more important to make sure the application will work if/when only a remote control is present".
Page 19-7: "You applications should be written to handle mouse input, even though the primary input device is a remote control. People watching your disc on a PC player will expect the mouse to work."