// C++ code
//
#define HID_CUSTOM_LAYOUT
#define LAYOUT_ITALIAN
//#include <HID-Project.h>
#include <Keyboard.h>
const int buttonPin_4 = 4;
const int buttonPin_6 = 6;
//char ctrlKey = KEY_LEFT_CTRL;
int push_button_4 = 0;
int push_button_6 = 0;
// Variables will change:
int lastButtonState_4 = 0; // previous state of the button
int lastButtonState_6 = 0;
void setup()
{
pinMode(4, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
Serial.begin(9600);
}
void loop()
{
push_button_4 = digitalRead(buttonPin_4);
push_button_6 = digitalRead(buttonPin_6);
//if (push_button_10 != lastButtonState_10 & push_button_10 == HIGH) {
// Serial.println("Shift+W+S");
//}
// if (push_button_9 != lastButtonState_9 & push_button_9 == HIGH) {
// Serial.println("Crtl+C");
// Keyboard.press(ctrlKey);
// Keyboard.press('c');
// delay(100);
// Keyboard.releaseAll();
// }
if (push_button_4 != lastButtonState_4 & push_button_4 == LOW) {
//if (digitalRead(push_button_8) == LOW ) {
// if the state has changed, increment the counter
Serial.println("Crtl+V");
Serial.println(digitalRead(push_button_4));
//Keyboard.press(ctrlKey);
//Keyboard.press('v');
//delay(100);
//Keyboard.releaseAll();
}
// save the current state as the last state, for next time through the loop
// lastButtonState_10 = push_button_10;
// lastButtonState_9 = push_button_9;
lastButtonState_4 = push_button_4;
delay(50);
}