/*
Keyboard logout
This sketch demonstrates the Keyboard library.
When you connect pin 2 to ground, it performs a logout.
It uses keyboard combinations to do this, as follows:
On Windows, CTRL-ALT-DEL followed by ALT-l
On Ubuntu, CTRL-ALT-DEL, and ENTER
On OSX, CMD-SHIFT-q
To wake: Spacebar.
Circuit:
- Arduino Leonardo or Micro
- wire to connect D2 to ground
created 6 Mar 2012
modified 27 Mar 2012
by Tom Igoe
This example is in the public domain.
https://www.arduino.cc/en/Tutorial/BuiltInExamples/KeyboardLogout
*/#define OSX 0
#define WINDOWS 1
#define UBUNTU 2
#include"Keyboard.h"// change this to match your platform:
intplatform=OSX;
voidsetup(){// make pin 2 an input and turn on the pull-up resistor so it goes high unless
// connected to ground:
pinMode(2,INPUT_PULLUP);Keyboard.begin();}