/AnalogNavigationKeyPad

Primary LanguageC++GNU General Public License v2.0GPL-2.0

Analog Navigation KeyPad Library

Simple analog keypad designed to recognize simultaneous button presses. Has a central 5-way joystick and two (left and right) buttons.

Can be used with a micro-controller, e.g. Arduino, or with a full blown machine connected to it via USB->GPIO, e.g. MCP2221A Breakout

Hardware

Schematics and PCB.

Schematics and PCB for SMD Version

PinOut

Pin Name Description
1 VCC Voltage supply. Connect to VCC of your controller.
2 A1 Connect to analog input of your controller.
3 A2 Connect to another analog input of your controller.
4 NC Not connected.
5 AGND Analog Ground or just Ground

Software Samples

Arduino C/C++:

  • AnalogNavigationKeyPad.ino - top level example
  • AnalogNavigationKeyPad.cpp - interface implementation
  • AnalogNavigationKeyPad.h - interface header

Python:

  • example.py - top level example
  • analog_navigation_keypad.py - interface implementation

Sequence of CallBacks

Single Button presses

MyNavKeyPad::onKeyDown vks=VK_SOFTA
MyNavKeyPad::onKeyUp vks=VK_SOFTA

First one then another button being pressed

MyNavKeyPad::onKeyDown vks=VK_SOFTA
MyNavKeyPad::onKeyAutoRepeat vks=VK_SOFTA
MyNavKeyPad::onKeyAutoRepeat vks=VK_SOFTA
MyNavKeyPad::onKeyAutoRepeat vks=VK_SOFTA
MyNavKeyPad::onKeyDown vks=VK_SOFTA VK_SOFTB
MyNavKeyPad::onKeyAutoRepeat vks=VK_SOFTA VK_SOFTB
MyNavKeyPad::onKeyAutoRepeat vks=VK_SOFTA VK_SOFTB
MyNavKeyPad::onKeyAutoRepeat vks=VK_SOFTA VK_SOFTB
MyNavKeyPad::onKeyAutoRepeat vks=VK_SOFTA VK_SOFTB
MyNavKeyPad::onKeyAutoRepeat vks=VK_SOFTA VK_SOFTB
MyNavKeyPad::onKeyAutoRepeat vks=VK_SOFTA VK_SOFTB
MyNavKeyPad::onKeyAutoRepeat vks=VK_SOFTA VK_SOFTB
MyNavKeyPad::onKeyAutoRepeat vks=VK_SOFTA VK_SOFTB
MyNavKeyPad::onKeyAutoRepeat vks=VK_SOFTA VK_SOFTB
MyNavKeyPad::onLongKeyDown vks=VK_SOFTA VK_SOFTB
MyNavKeyPad::onKeyAutoRepeat vks=VK_SOFTA VK_SOFTB
MyNavKeyPad::onKeyUp vks=VK_SOFTA VK_SOFTB
MyNavKeyPad::onKeyUp vks=VK_SOFTB