Wednesday, August 5, 2015

Version 44 Code with CTRL-ALT E

John Saltsman updated the example to work with the OSv44 log-in screen as well as adding in the CTRL+ALT+E since that is the step some people miss most often : 

/*  A few reminders
   - ever statment in C needs to end in an semicolon otherwise you will get an error
   - make sure you go into tools>USB Type> and then select keyboard+mouse+joystick otherwise you'll get the error "keyboard not reconized"
   - this https://www.pjrc.com/teensy/td_keyboard.html and this https://www.arduino.cc/en/Reference/HomePage are helpful

 */

void setup() { //this loop will run once
  //gives the computer time to reconize the device 
  delay(4000); // it times in miliseconds
}
void loop(){//this loop will keep repeating

Keyboard.set_modifier(MODIFIERKEY_CTRL); // press and hold CTRL
Keyboard.send_now();

Keyboard.set_modifier(MODIFIERKEY_CTRL | MODIFIERKEY_ALT); // press ALT while still holding CTRL
Keyboard.send_now();

Keyboard.set_key1(KEY_E); // press E, while CLTR and ALT still held
Keyboard.send_now();

Keyboard.set_modifier(0); // release all the keys at the same instant
Keyboard.set_key1(0);
Keyboard.send_now();

delay(1000);

Keyboard.set_key1(KEY_TAB); //the next for lines tell the computer to send the TAB key
Keyboard.send_now();
Keyboard.set_key1(0);  //these next two lines tell the comuputer to stop sending the TAB key
Keyboard.send_now();
  
Keyboard.print("username@domain.org"); //types username
   
delay(1000);
   
Keyboard.set_key1(KEY_ENTER); //the next for lines tell the computer to send the Enter key
Keyboard.send_now();
Keyboard.set_key1(0);  //these next two lines tell the comuputer to stop sending the Enter key
Keyboard.send_now();
   
delay(500);
   
Keyboard.print("passwordgoeshere"); //types password

Keyboard.set_key1(KEY_ENTER); //the next for lines tell the computer to send the Enter key
Keyboard.send_now();
Keyboard.set_key1(0);  //these next two lines tell the comuputer to stop sending the Enter key
Keyboard.send_now();
   
delay(15000); //time before repeat optional
}


/*Keep mouse between these dashes otherwise the teensy will type into your code


*/

No comments:

Post a Comment