Skip to content

An Arduino library. Simple way to map a push-button to a keyboard key. This library utilize the ability of 32u4-based Arduino-compatible boards to emulate USB-keyboard.

License

Notifications You must be signed in to change notification settings

klenov/keyboardButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keyboardButton

This library will work only on 32u4-based boards (Arduino Leonardo or Micro, SparkFun Pro Micro, Adafruit Feather etc) and only on pins with external interrupt support.

On Micro, Leonardo and other 32u4-based boards there are 5 external interrupts available on pins 0, 1, 2, 3, 7.

Example

#include <KeyboardButton.h>

void setup() {
  Keyboard.begin();

  KeyboardButton::enableButton(0, KEY_UP_ARROW);
  KeyboardButton::enableButton(1, KEY_DOWN_ARROW);
  
  KeyboardButton::enableButton(3, 'a');
  KeyboardButton::enableButton(7, 'b');
}

void loop() {
  KeyboardButton::updateButtons();
}

Useful links

Tested with

  • Pro Micro

About

An Arduino library. Simple way to map a push-button to a keyboard key. This library utilize the ability of 32u4-based Arduino-compatible boards to emulate USB-keyboard.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages