dev42
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2015
12:30 PM
roMessageDialog & buffered button presses
I recently started using a roMessageDialog ontop of a roScreen and have noticed that the up & down & OK button presses are buffered and my app does stuff with them after the roMessageDialog is closed.
Is there a way to empty the button press buffer?
Other suggestions for dealing with this are welcome. ( I'm sure in another context this might be a feature! )
peace & 42
Is there a way to empty the button press buffer?
Other suggestions for dealing with this are welcome. ( I'm sure in another context this might be a feature! )
peace & 42
3 REPLIES 3

Komag
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2015
02:34 PM
Re: roMessageDialog & buffered button presses
I don't know quite how it would work with a message dialog open, but I have called port.GetMessage() in a temporary while loop to constantly clear through anything coming in. For all I know it's a bad idea though, not an expert.
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2015
05:08 PM
Re: roMessageDialog & buffered button presses
Roku does not recommend that 2D components and built-in BrightScript components co-exist. In situations like that I'll invalidate my roScreen AND its associated roMessagePort before showing the built-in component, then re-create them after closing the built-in component. Invalidating the roScreen's port ensures that none of the key press events that occurred while the built-in component was displayed will be received by the roScreen's port. If you do invalidate the roScreen at any point, make sure there is an underlying facade layer (e.g. an roImageCanvas), otherwise the channel will close when the roScreen is closed. This does mean, however, that you won't be able to get the roMessageDialog overlaid on top of the roScreen, although that's not really a supported feature anyway; if it works today, it may not work tomorrow. Another option is to build your own 2D message dialog using the same roScreen and roMessagePort, then you can do whatever you want with the screen display and key press events.
dev42
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2015
02:53 PM
Re: roMessageDialog & buffered button presses
TYVM to both of you!
peace & 42
peace & 42