diff options
author | Florrie <towerofnix@gmail.com> | 2019-07-18 22:46:00 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2019-07-18 22:46:00 -0300 |
commit | 7bf0f9016cd195be20e76fbed8637b3b00a46725 (patch) | |
tree | 6ff7e2f829df0386120cb53cf3b7c37f4b748366 /ui | |
parent | 9210cbf5986f4e7b796d39fe36d81aeab1992ae3 (diff) |
Mouse drag support; pass detailed data to handlers
...for mouse events. Contains cursor position, modifier keys pressed, etc.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/Root.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/Root.js b/ui/Root.js index 3bd4767..8242f7a 100644 --- a/ui/Root.js +++ b/ui/Root.js @@ -29,13 +29,14 @@ module.exports = class Root extends DisplayElement { handleData(buffer) { if (telc.isMouse(buffer)) { - const { button, line, col } = telc.parseMouse(buffer) + const allData = telc.parseMouse(buffer) + const { button, line, col } = allData const topEl = this.getElementAt(col - 1, line - 1) if (topEl) { //console.log('Clicked', topEl.constructor.name, 'of', topEl.parent.constructor.name) this.eachAncestor(topEl, el => { if (typeof el.clicked === 'function') { - return el.clicked(button) === false + return el.clicked(button, allData) === false } }) } |