remember last button for mouseup on x10 and urxvt protocols.

This commit is contained in:
Christopher Jeffrey 2015-02-24 18:19:16 -08:00
parent ad546d9af9
commit 02fd115fb0
2 changed files with 6 additions and 3 deletions

View File

@ -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.

View File

@ -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;
} }
} }