From 3732cc4e204654be2cdaa5df00db6f2c72f5a7fb Mon Sep 17 00:00:00 2001 From: Andrey Sidorov Date: Wed, 18 Jan 2012 16:48:54 +1100 Subject: [PATCH] keyboard event --- lib/x11/xcore.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) {