#include <Keyboard.h>
const int buttonPin = 2;
const int button2Pin = 3;
const int buzzerPin = 4;
bool pressed = false;
bool pressed2 = false;
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
pinMode(buttonPin, INPUT);
pinMode(button2Pin, INPUT);
pinMode(buzzerPin, OUTPUT);
digitalWrite(buzzerPin, HIGH);
Keyboard.begin();
}
void loop() {
if(digitalRead(buttonPin) == HIGH && pressed == false) {
pressed = true;
Keyboard.print("< KULLANICI ADINIZI BURAYA GIRIN >");
// Kullanıcı adı girildi
delay(50);
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);
delay(200);
// Enter basıldı!
Keyboard.print("< SIFRENIZI BURAYA GIRIN >");
delay(5);
// Şifre girildi!
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);
delay(6000);
// Enter basıldı!
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('d');
Keyboard.release(KEY_LEFT_GUI);
Keyboard.release('d');
delay(100);
// Rofi açıldı!
Keyboard.print("chrom");
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);
delay(5);
// Firefox açıldı!
digitalWrite(buzzerPin, LOW);
delay(150);
digitalWrite(buzzerPin, HIGH);
delay(500);
}
else if(digitalRead(button2Pin) == HIGH && pressed2 == false) {
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press(KEY_RETURN);
Keyboard.releaseAll();
delay(500);
// Terminal açıldı!
Keyboard.print("sudo poweroff");
Keyboard.press(KEY_RETURN);
Keyboard.release(KEY_RETURN);
// Kapatma komutu girildi!
pressed2=true;
}
}