diff --git a/lib/x11/corereqs.js b/lib/x11/corereqs.js index ab3c5c6..24773b9 100644 --- a/lib/x11/corereqs.js +++ b/lib/x11/corereqs.js @@ -241,6 +241,14 @@ module.exports = { } ], + WarpPointer: [ + + function (srcWin, dstWin, srcX, srcY, srcWidth, srcHeight, dstX, dstY) + { + return [ 'CxSLLssSSss', [41, 6, srcWin, dstWin, srcX, srcY, srcWidth, srcHeight, dstX, dstY] ]; + } + ], + CreatePixmap: [ function(pid, drawable, depth, width, height) { console.log(['CreatePixmap:', 'CCSLLSS', [53, depth, 4, pid, drawable, width, height]]); diff --git a/test/warppointer.js b/test/warppointer.js new file mode 100644 index 0000000..d363381 --- /dev/null +++ b/test/warppointer.js @@ -0,0 +1,9 @@ +var angle = 0; +var x11 = require('../lib/x11').createClient(function(display) { + setInterval(function() { + var x = 500 + 100*Math.cos(angle*100); + var y = 500 + 100*Math.sin(angle*100); + display.client.WarpPointer(0, display.screen[0].root, 0, 0, 0, 0, parseInt(x), parseInt(y)); + angle += 0.05; + }, 100); +});