keyboard event

This commit is contained in:
Andrey Sidorov 2012-01-18 16:48:54 +11:00
parent 14b9c87d55
commit 3732cc4e20

View file

@ -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)
{