diff --git a/lib/x11/xcore.js b/lib/x11/xcore.js index 288927d..0ed03a3 100644 --- a/lib/x11/xcore.js +++ b/lib/x11/xcore.js @@ -170,7 +170,7 @@ XClient.prototype.unpackEvent = function(type, seq, extra, code, raw) event.type = type; event.seq = seq; - if (type == 2 || type == 4 || type == 5 || type == 6) { // motion event + if (type == 2 || type == 3 || type == 4 || type == 5 || type == 6) { // motion event var values = raw.unpack('LLLssssSC'); //event.raw = values; // TODO: use unpackTo??? @@ -352,10 +352,15 @@ module.exports.createClient = function(initCb, display) } else if(host == '127.0.0.1') socketPath = '/tmp/.X11-unix/X' + displayNum; } + socketPath = display; if(socketPath) + { stream = net.createConnection(socketPath); + } else + { stream = net.createConnection(6000 + parseInt(displayNum), host); + } var client = new XClient(stream, displayNum, screenNum); if (initCb) {