Saltar a contenido

Portapapeles

Utilizando estos métodos es posible interactuar con el contenido del portapapeles, los métodos del portapapeles pueden ser útiles cuando es necesario realizar operaciones como Ctrl+C y Ctrl+V.

Copiar al Portapapeles

Puedes copiar contenido de texto al portapapeles.

# Copy to the clipboard.
bot.copy_to_clipboard("My text content")

# Performing a CTRL + V operation that will use the clipboard content.
bot.control_v()
// Copy to the clipboard.
copyToClipboard("My text content");

// Performing a CTRL + V operation that will use the clipboard content.
controlV();
// Copy to the clipboard.
await desktopBot.setClipboard('My text content')

// Performing a CTRL + V operation that will use the clipboard content.
await desktopBot.controlV()
// Copy to the clipboard.
await desktopBot.setClipboard('My text content')

// Performing a CTRL + V operation that will use the clipboard content.
await desktopBot.controlV()

Pegar

Puedes utilizar este método para utilizar el contenido del portapapeles o utilizar un contenido de texto específico.

# Using the paste method without parameters will have the same effect as using control_v.
bot.paste()

# You can also use this method already passing the text that will be used.
bot.paste("My text content")
// Utilizar el método paste tendrá el mismo efecto que utilizar controlV.
paste("Mi contenido de texto");
// Using the paste method without parameters will have the same effect as using control_v.
await desktopBot.paste()

// You can also use this method already passing the text that will be used.
await desktopBot.paste('My text content')
// Using the paste method without parameters will have the same effect as using control_v.
await desktopBot.paste()

// You can also use this method already passing the text that will be used.
await desktopBot.paste('My text content')

Obtener Portapapeles

Además de establecer el contenido, también puedes obtener el contenido actual del portapapeles.

# Performing a CTRL + C operation to get some content.
bot.control_c()

# Getting clipboard current content.
print(bot.get_clipboard())
// Performing a CTRL + C operation to get some content.
controlC();

// Getting clipboard current content.
System.out.println(getClipboard());
// Performing a CTRL + C operation to get some content.
await desktopBot.controlC()

// Getting clipboard current content.
console.log(await desktopBot.getClipboard())
// Performing a CTRL + C operation to get some content.
await desktopBot.controlC()

// Getting clipboard current content.
console.log(await desktopBot.getClipboard())