Options
All
  • Public
  • Public/Protected
  • All
Menu

Module clip_manager

Clipboard module, used to get and set clipboard content. In Android 10 or higher, unless the app has focus, the app cannot access clipboard data.

see

Limited access to clipboard data

Index

Variables

Const clipboardManager

clipboardManager: ClipboardManager = ...

Clipboard manager. Used to get, set, and listen to clipboard content.

see

ClipboardManager

example
const { clipboardManager, getClip } = require('clip_manager');
clipboardManager.on("clip_changed", () => {
  console.log("clipboard changed:", getClip());
});
$autojs.keepRunning();

Functions

clearClip

  • clearClip(): void
  • Clear clipboard content.

    example
    "nodejs";
    const { clearClip } = require('clip_manager');
    clearClip();
    

    Returns void

getClip

  • getClip(): string | null
  • Get clipboard content.

    example
    "nodejs";
    const { getClip } = require('clip_manager');
    console.log(getClip());
    

    Returns string | null

    Text content

hasClip

  • hasClip(): boolean
  • Determine if clipboard has content.

    example
    "nodejs";
    const { hasClip } = require('clip_manager');
    console.log(hasClip());
    

    Returns boolean

    If there is content, return true, otherwise return false.

setClip

  • setClip(text: string): void
  • Set clipboard content.

    example
    "nodejs";
    const { setClip } = require('clip_manager');
    setClip('Hello World!');
    

    Parameters

    • text: string

      Text content

    Returns void