如何在arduino中按WINDOWS + R?

问题描述

我想用arduino写点东西,但是它不能打开WINDOWS + R。 我写了这段代码

#include <Keyboard.h>

// Utility function
void typeKey(int key){
Keyboard.press(key);
delay(50);
Keyboard.release(key);
}

void setup()
{
// Start Keyboard and Mouse
Keyboard.begin();

// Start Payload
// Happy Holidays By Ghostshell

Keyboard.press(KEY_RIGHT_GUI);
Keyboard.press('r');
Keyboard.releaseAll();

delay(1000);

Keyboard.print("notepad.exe");

typeKey(KEY_RETURN);

delay(1000);

Keyboard.print("         _");

typeKey(KEY_RETURN);

Keyboard.print("      |\\ 0 /|");

typeKey(KEY_RETURN);

Keyboard.print("       |/|\\|");

typeKey(KEY_RETURN);

Keyboard.print("         |");

typeKey(KEY_RETURN);

Keyboard.print("         @");

typeKey(KEY_RETURN);

Keyboard.print("        /+\\");

typeKey(KEY_RETURN);

Keyboard.print("       o/@\\\\");

typeKey(KEY_RETURN);

Keyboard.print("     +//o/\\\\o");

typeKey(KEY_RETURN);

Keyboard.print("     //+/@\\\\/+o");

typeKey(KEY_RETURN);

Keyboard.print("    /\\/o//+/\\\\\\\\");

typeKey(KEY_RETURN);

Keyboard.print("   +///\\//\\o\\o+\\\\o");

typeKey(KEY_RETURN);

Keyboard.print("  o/+@/++/\\\\\\@\\\\/\\+");

typeKey(KEY_RETURN);

Keyboard.print(" /\\/+///o/@\\o+/\\+\\\\");

typeKey(KEY_RETURN);

Keyboard.print("o/+/\\/@//||\\/\\\\o\\\\\\o _");

typeKey(KEY_RETURN);

Keyboard.print(" /__ /|  ||      /__ /|");

typeKey(KEY_RETURN);

Keyboard.print("| * | | (__)___ | * | |");

typeKey(KEY_RETURN);

Keyboard.print("|___|/_   /__ /||___|/");

typeKey(KEY_RETURN);

Keyboard.print("    /_/| | * | |");

typeKey(KEY_RETURN);

Keyboard.print("   |_|/  |___|/");

typeKey(KEY_RETURN);

Keyboard.print("     `-.____/");

typeKey(KEY_RETURN);

typeKey(KEY_RETURN);

Keyboard.print("It was the");

typeKey(KEY_RETURN);

Keyboard.print("Night");

typeKey(KEY_RETURN);

Keyboard.print("before");

typeKey(KEY_RETURN);

Keyboard.print("Christmas...");

typeKey(KEY_RETURN);

Keyboard.print("And All Through");

typeKey(KEY_RETURN);

Keyboard.print("The House....");

typeKey(KEY_RETURN);

Keyboard.print("Not A Creature Was");

typeKey(KEY_RETURN);

Keyboard.print("Sturring...");

typeKey(KEY_RETURN);

Keyboard.print("Not Even");

typeKey(KEY_RETURN);

Keyboard.print("A Mouse");

typeKey(KEY_RETURN);

typeKey(KEY_RETURN);

Keyboard.print("Happy Holidays To All!!");



typeKey(KEY_RETURN);

  typeKey(KEY_RETURN);

  Keyboard.print("From");

  typeKey(KEY_RETURN);

  typeKey(KEY_RETURN);

  Keyboard.print("Cheers!!");

  typeKey(KEY_RETURN);

  delay(100);

  // End Payload

  // Stop Keyboard and Mouse
  Keyboard.end();
}

// Unused
void loop() {}

在已打开记事本的情况下运行此代码时,它可以工作,但无法打开WINDOWS + R

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)