diff --git a/lib/xcore.js b/lib/xcore.js index 59ddbdd..218c71d 100644 --- a/lib/xcore.js +++ b/lib/xcore.js @@ -235,7 +235,9 @@ XClient.prototype.AllocID = function() XClient.prototype.unpackEvent = function(type, seq, extra, code, raw) { var event = {}; // TODO: constructor & base functions - event.type = type; + // Remove the most significant bit. See Chapter 1, Event Format section in X11 protocol + // specification + event.type = type && 0x7F; event.seq = seq; var extUnpacker = this.eventParsers[type];