File: kwin-retrieve-mouse-pointer-pos.js

package info (click to toggle)
accerciser 3.48.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,944 kB
  • sloc: python: 10,674; javascript: 163; xml: 94; makefile: 49; sh: 2
file content (17 lines) | stat: -rw-r--r-- 530 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
 * @license: BSD
 *
 * All rights reserved. This program and the accompanying materials are made
 * available under the terms of the BSD which accompanies this distribution, and
 * is available at U{http://www.opensource.org/licenses/bsd-license.php}
 */

// JavaScript script to retrieve mouse cursor/pointer position via KWin API

let mouse_pos = {
    "mouse-pointer-pos.x": workspace.cursorPos.x,
    "mouse-pointer-pos.y": workspace.cursorPos.y
};

const json_output = JSON.stringify(mouse_pos);
console.info(json_output)