From b561f48209b1154e37fe274c6838f7f91b549d87 Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 21 Jul 2025 23:01:38 +0200 Subject: [PATCH] Mon 21 Jul 22:43:21 CEST 2025 --- .../core/examples/smoketest/query_pointer.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 js/x11/core/examples/smoketest/query_pointer.js diff --git a/js/x11/core/examples/smoketest/query_pointer.js b/js/x11/core/examples/smoketest/query_pointer.js new file mode 100644 index 0000000..718c823 --- /dev/null +++ b/js/x11/core/examples/smoketest/query_pointer.js @@ -0,0 +1,19 @@ +var x11 = require('../../lib'); +x11.createClient(function(err, display) { + var X = display.client; + var screen = display.screen[0]; + var wid = X.AllocID(); + X.CreateWindow(wid, screen.root, 0, 0, 400, 300); + X.MapWindow(wid); + var interval = setInterval( function() { + X.QueryPointer(wid, function(err, res) { + console.log(res); + }); + }, 1000); + + X.on('error', function(err) { + console.log(err); + }); + X.on('end', function () { clearInterval(interval); }); +}); +