mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-11 03:25:45 +00:00
remember last button for mouseup on x10 and urxvt protocols.
This commit is contained in:
parent
ad546d9af9
commit
02fd115fb0
@ -488,7 +488,8 @@ Program.prototype._bindMouse = function(s, buf) {
|
|||||||
// NOTE: x10 and urxvt have no way
|
// NOTE: x10 and urxvt have no way
|
||||||
// of telling which button mouseup used.
|
// of telling which button mouseup used.
|
||||||
key.action = 'mouseup';
|
key.action = 'mouseup';
|
||||||
key.button = 'unknown';
|
key.button = this._lastButton || 'unknown';
|
||||||
|
delete this._lastButton;
|
||||||
} else {
|
} else {
|
||||||
key.action = 'mousedown';
|
key.action = 'mousedown';
|
||||||
var button = b & 3;
|
var button = b & 3;
|
||||||
@ -497,6 +498,7 @@ Program.prototype._bindMouse = function(s, buf) {
|
|||||||
: button === 1 ? 'middle'
|
: button === 1 ? 'middle'
|
||||||
: button === 2 ? 'right'
|
: button === 2 ? 'right'
|
||||||
: 'unknown';
|
: 'unknown';
|
||||||
|
this._lastButton = key.button;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Probably a movement.
|
// Probably a movement.
|
||||||
@ -558,7 +560,8 @@ Program.prototype._bindMouse = function(s, buf) {
|
|||||||
// NOTE: x10 and urxvt have no way
|
// NOTE: x10 and urxvt have no way
|
||||||
// of telling which button mouseup used.
|
// of telling which button mouseup used.
|
||||||
key.action = 'mouseup';
|
key.action = 'mouseup';
|
||||||
key.button = 'unknown';
|
key.button = this._lastButton || 'unknown';
|
||||||
|
delete this._lastButton;
|
||||||
} else {
|
} else {
|
||||||
key.action = 'mousedown';
|
key.action = 'mousedown';
|
||||||
var button = b & 3;
|
var button = b & 3;
|
||||||
@ -567,6 +570,7 @@ Program.prototype._bindMouse = function(s, buf) {
|
|||||||
: button === 1 ? 'middle'
|
: button === 1 ? 'middle'
|
||||||
: button === 2 ? 'right'
|
: button === 2 ? 'right'
|
||||||
: 'unknown';
|
: 'unknown';
|
||||||
|
this._lastButton = key.button;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Probably a movement.
|
// Probably a movement.
|
||||||
|
@ -552,7 +552,6 @@ Screen.prototype._listenMouse = function(el) {
|
|||||||
set = true;
|
set = true;
|
||||||
}
|
}
|
||||||
el.emit(data.action, data);
|
el.emit(data.action, data);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user