Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
globaluserinput
Advanced tools
Readme
Global User Input
😎 Bi-directional global user input; Read/Write key events on Windows!
Last Update (2.0.0)
Example
const gui = require("globaluserinput").default;
gui.init();
gui.on("keyboard:keydown", ({ key }) => {
console.log("User pressed to key:", key);
});
gui.on("mouse:move", ({ x, y }) => {
console.log("User moved the mouse:", x, y);
});
// Click the left mouse button every one second.
setInterval(()=>{
gui.mouse.click(1);
}, 1000);
API
init(): void
: Initializes the global user input.
keyboard: Object
isDown(key): boolean
: Key code is required. And it returnstrue
if the key is down.
down(key): any
: Key code is required. Sends akeydown
event to the active window/desktop.
up(key): any
: Key code is required. Sends akeyup
event to the active window/desktop.
press(key): any
: Key code is required. Sends akeypress
event to the active window/desktop. Basicly it sends akeydown
and akeyup
event.
mouse: Object
x: number
: X position of the mouse.
y: number
: Y position of the mouse.
isDown(key): boolean
: Key code is required. And it returnstrue
if the key is down.
down(key, x?, y?): any
: Key code is required. Sends amousedown
event to the active window/desktop.
up(key, x?, y?): any
: Key code is required. Sends amouseup
event to the active window/desktop.
move(x, y): any
: X and Y is required. Sends amousemove
event to the active window/desktop.
click(key, x?, y?): any
: Key code is required. Basicly sends amousedown
and amouseup
event.
on(event, listener): any
Shortcut for the
this.events.on()
. Also you can listen for these events:
mouse:move
: Object
x: number
: X position of the mouse.y: number
: Y position of the mouse.mouse:keyup
: Object
x: number
: X position of the mouse.y: number
: Y position of the mouse.key: number
: Keycode of the key.mouse:keydown
: Object
x: number
: X position of the mouse.y: number
: Y position of the mouse.key: number
: Keycode of the key.keyboard:keyup
: Object
key: number
: Keycode of the key.keyboard:keydown
: Object
key: number
: Keycode of the key.keyboard:keypress
: Object
key: number
: Keycode of the key.
off(event, listener): any
Shortcut for the
this.events.off()
.
events: EventEmitter
- Node.js event emitter.
FAQs
😎 Bi-directional global user input; Read/Write key events on Windows!
The npm package globaluserinput receives a total of 2 weekly downloads. As such, globaluserinput popularity was classified as not popular.
We found that globaluserinput demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.