Fix some event names

- ButtonPress, ButtonRelease, MotionNotify and EnterNotify
This commit is contained in:
Santiago Gimeno 2014-01-28 12:14:19 +01:00
parent 69825534f6
commit 1e36e5d426

View file

@ -254,7 +254,7 @@ XClient.prototype.unpackEvent = function(type, seq, extra, code, raw)
var values = raw.unpack('LLLssssSC');
//event.raw = values;
// TODO: use unpackTo???
event.name = [,,'KeyPress', 'KeyRelease', 'MouseDown', 'MouseUp', 'MouseMove'][type]
event.name = [,,'KeyPress', 'KeyRelease', 'ButtonPress', 'ButtonRelease', 'MotionNotify'][type]
event.time = extra;
event.keycode = code;
event.root = values[0];
@ -266,8 +266,8 @@ XClient.prototype.unpackEvent = function(type, seq, extra, code, raw)
event.y = values[6];
event.buttons = values[7];
event.sameScreen = values[8];
} else if (type == 7) { //EnterWindow
event.name = 'EnterWindow'
} else if (type == 7) { //EnterNotify
event.name = 'EnterNotify'
var values = raw.unpack('LLLssssSC');
event.root = values[0]
event.wid = values[1]