Mini HID Keypad

Mini Keypad used as HID for computer. Customize to work with any computer.
15
88
0
1377
updated September 3, 2019

Description

PDF

Mini Keypad used as HID for computer. Customize to work with any computer. For a complete listing of character maps, do a simple search for "ASCII character map"

Print instructions

Only requirements are an Arduino Pro Micro (I used a clone board from Amazon -- HiLetgo 3pcs Pro Micro Atmega32U4 5V 16MHz)

You will also need some LEDs (rectangular white 3v, 20mA from Amazon -- Chanzon 100 pcs 2x5x7 mm White LED Diode Lights)

Tactile switches (again from Amazon --Cylewet 25Pcs 12x12x7.3mm Momentary Tact Tactile Push Button Switch)

20ga hookup wire required, choose your own

100ohm Resistors (this will change if you use a different color LED)

Wiring instructions-- solder everything once you test that the code works for what you want it to do.

Wire all LEDs in parallel with resistor on the Anode (+, or the long one), connect all resistors to one lead, and connect that to the 5V pin on the Arduino.

Wire all LED cathodes (-, or the short one) together along with one side of each of the switches together, and connect to one lead and connect that to the GND pin on the Arduino.

All switches connected to pins 2, 3, 4, 5, 6, & 7. When pressed it should connect the ground to the pins.

Arduino code follows:

/*

  • MiniKeyPad
  • 29 AUG 2019
    */

include <Keyboard.h>

//---------------------------------------------------------
// Setup
//---------------------------------------------------------

void setup() {
pinMode(2,INPUT_PULLUP); // sets pin 2 to input & pulls it high w/ internal resistor
pinMode(3,INPUT_PULLUP); // sets pin 3 to input & pulls it high w/ internal resistor
pinMode(4,INPUT_PULLUP); // sets pin 4 to input & pulls it high w/ internal resistor
pinMode(5,INPUT_PULLUP); // sets pin 5 to input & pulls it high w/ internal resistor
pinMode(6,INPUT_PULLUP); // sets pin 6 to input & pulls it high w/ internal resistor
pinMode(7,INPUT_PULLUP); // sets pin 7 to input & pulls it high w/ internal resistor

Serial.begin(9600); // begin serial for debugging

}

//---------------------------------------------------------
// Loop
//---------------------------------------------------------

void loop() {

Keyboard.begin(); //begin keyboard
if (digitalRead(2) == 0) // if buton 2 is pushed - Emulates Spotlight Search
{
// For a single keypress use press() and release()
Keyboard.press(KEY_LEFT_GUI); // Presses the Mac Command key
Keyboard.press((char) 32); // Presses the space key
Keyboard.releaseAll();
delay(200); // delay to emulate short press
}
else if (digitalRead(3) == 0) // if button 3 is pressed - Emulates Window Select
{
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press((char) 0x09); // Presses the TAB key
Keyboard.releaseAll();

delay(300);

}
else if (digitalRead(4) == 0) // if button 4 is pressed - Emulates Save Function
{
Keyboard.press(KEY_LEFT_GUI); // Presses the z key
Keyboard.press('s');
Keyboard.releaseAll();

delay(300);

}
else if (digitalRead(5) == 0) // if button 5 is pressed - Emulates Redo Function
{
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press(KEY_LEFT_SHIFT);
Keyboard.press('z'); // Presses the z key
Keyboard.releaseAll();

delay(300);

}
else if (digitalRead(6) == 0) // if button 6 is pressed - Emulates Find Function
{
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('f'); // Presses the f key
Keyboard.releaseAll();

delay(300);

}
else if (digitalRead(7) == 0) // if button 7 is pressed - Emulates Undo Function
{
Keyboard.press(KEY_LEFT_GUI); // Presses the shift key
Keyboard.press('z'); // Presses the z key
Keyboard.releaseAll();

delay(300);

}
Keyboard.end(); //stops keybord
}

Tags



Model origin

The author hasn't provided the model origin yet.

License


Highlighted models from creator

View more