Mouse support for LG MRCU

I’ve developed a Smart TV app (available for Tizen, webOS, VIDAA and other OS) using Vanilla Javascript and jQuery, but I would like to refactor it using Lightningjs SDK and its UI Components.

By the way, in order to deploy on LG Store, also the MRCU (the LG’s magic remote) must be usable. I my current app I listen the mouse events like mouseover, click and some other specific LG events for scrolling, but I don’t find any way to use the mouse with Lightningjs.

Any help on this?


There are a couple of examples available:
mouse: Lightning/examples/mouse-pointer at master · rdkcentral/Lightning · GitHub
touch: Lightning/examples/touch at master · rdkcentral/Lightning · GitHub

And we’ve build a touch library specially for automotive that may help you on your way:
Library: GitHub - rdkcentral/Lightning-Automotive: Lightning with support for Automotive industry use cases
Ui demo: GitHub - mlapps/com.metrological.ui.Automotive

1 Like

Thanks @erikhaandrikman for the suggestions; I suppose I need to use the enablePointer and collision attributes.

I added the collision: true and the handlers on a custom Button that exists in a Lightning.Component used as page of a @lightningjs/sdk’s Router.App; initially it doesn’t work. After some attemps I notice that I also need to add the collision: true in template() function of the main App component, like

static _template() {
return {
collision: true,

After that, it works. But why I need to do that?

Next to that Button I also have a @lightningjs/ui's Grid where I added some instance of the same Button, but no handle has been executed when the mouse is over o I click on that elements…

Where I can find some documentations about the enablePointer, or collision, or the other params to use for manage the mouse capabilities?

Thank you very much

Debugging the app with inspector: true mode I noticed that if I click on a Button inside the Grid component, in fireBottomUpClickHandler the
var target = this._getTargetChild(clientX, clientY);
returns null.

Maybe there is some issue during the tree creation related to Grid component?