QueryPointer result unpacking

This commit is contained in:
Andrey Sidorov 2012-12-20 00:54:19 +11:00
parent 5b17a21eff
commit a951aa26cb

View file

@ -117,6 +117,8 @@ module.exports = {
// create request packet - function OR format string // create request packet - function OR format string
function(id, parentId, x, y, width, height, borderWidth, depth, _class, visual, values) { function(id, parentId, x, y, width, height, borderWidth, depth, _class, visual, values) {
console.log(values);
if (borderWidth === undefined) if (borderWidth === undefined)
borderWidth = 0; borderWidth = 0;
if (depth === undefined) if (depth === undefined)
@ -386,9 +388,16 @@ module.exports = {
QueryPointer: [ QueryPointer: [
[ 'CxSL', [38, 2] ], [ 'CxSL', [38, 2] ],
function(buf) { function(buf) {
var res = buf.unpack('LLSSSSS'); // TODO: should be unsigned var res = buf.unpack('LLssssS');
// TODO pack array into named fields return {
return res; root: res[0],
child: res[1],
rootX: res[2],
rootY: res[3],
childX: res[4],
childY: res[5],
keyMask: res[6]
};
} }
], ],