Yomguithereal / react-blessed

A react renderer for blessed.
MIT License
4.45k stars 176 forks source link

Mouse events #24

Open brigand opened 9 years ago

brigand commented 9 years ago

In the blessed Program docs:

enableMouse([el]) - Enable mouse events for the screen and optionally an element (automatically called when a form of on('mouse') is bound).

Because react-blessed only listens for 'event', the mouse events are never bound. This causes a lot of interactions, such as focusing an input with a click, to be ignored. Enabling it globally doesn't seemt to affect the children.

Maybe just .on('mouse', noop)? It seems to fix the problem, but I'm not sure if there are any other side effects.

Yomguithereal commented 9 years ago

Hello @brigand. The event event is fired when any event is fired. So event should also be fired when the mouse event is. Even when globally registered, the events are supposed to bubble. I must check what went wrong here. Can you try to pass the mouse prop as true to some of your relevant blessed nodes?

On a side note, I think mouse-related events don't work on Mac OSX standard terminal.