File keyboard.hpp
FileList > keyboard > keyboard.hpp
Go to the source code of this file
Header file for keyboard functions and keymaps. More...
#include <Arduino.h>
#include <Wire.h>
Public Types
Type | Name |
---|---|
enum | KeyState |
Public Attributes
Type | Name |
---|---|
bool | altLock |
bool | backlightState |
bool | capsLock |
uint8_t | cols |
bool | ctrlLock |
uint8_t | currentBrightness |
char | defaultKeymap |
uint8_t | emptyData |
uint8_t | keyInfo |
unsigned long | keyRepeatStart |
KeyState | keyStates |
uint8_t | keymapIndex |
bool | lastValue |
uint8_t | rows |
uint8_t | sendData |
bool | sendDataFlag |
char | symbolKeymap1 |
char | symbolKeymap2 |
char | symbolKeymap3 |
char | symbolKeymap4 |
char | symbolKeymap5 |
char | symbolKeymap6 |
char | symbolKeymap7 |
bool | symbolLock |
Public Functions
Type | Name |
---|---|
void | autoResetKeymapIndex () Handles resetting the keymap index. |
bool | doesKeyExistInKeymap (int rowIndex, int colIndex, char keymap) Checks if a key exists in the keymap. |
void | handleCharacter (int rowIndex, int colIndex) Handles the character for a specific key. |
bool | keyHeld (int rowIndex, int colIndex) Checks if a key is being held. |
bool | keyNotPressed (int rowIndex, int colIndex) Checks if a key is not pressed. |
bool | keyPressed (int rowIndex, int colIndex) Checks if a key was pressed. |
bool | keyReleased (int rowIndex, int colIndex) Checks if a key was released. |
void | onRequest () Handles I2C requests. |
void | printKeyInfo (uint8_t data) Prints the key information. |
void | readKeyMatrix () Reads the key matrix and updates the key states. |
void | sendKeyInfo () Sends the key information over I2C. |
void | setDefaultCharacter (int rowIndex, int colIndex) Sets keyInfo to the correct character for a specific key, from the default keymap only. |
void | setKeyboardBrightness (uint8_t command) Sets the keyboard backlight brightness. |
void | setSymbolCharacter (int rowIndex, int colIndex) Sets keyInfo to the correct character for a specific key, from the symbol keymaps only. |
Macros
Type | Name |
---|---|
define | COL_COUNT 7 |
define | DEBOUNCE_DELAY 50 |
define | FUNCTION_DOWN 0x02 |
define | FUNCTION_TOGGLE 0x01 |
define | FUNCTION_UP 0x03 |
define | I2C_DEV_ADDR 0x55 |
define | KEYBOARD_BACKLIGHT_PIN 9 |
define | KEYBOARD_BRIGHTNESS_CH 0 |
define | KEYBOARD_BRIGHTNESS_DEFAULT 119 |
define | KEYBOARD_BRIGHTNESS_FREQ 1000 |
define | KEYBOARD_BRIGHTNESS_MAX 255 |
define | KEYBOARD_BRIGHTNESS_MIN 0 |
define | KEYBOARD_BRIGHTNESS_RES 8 |
define | KEYBOARD_BRIGHTNESS_STEP 17 |
define | KEY_INFO_SIZE 7 |
define | KEY_REPEAT_DELAY 200 |
define | MAX_KEYMAP_INDEX 8 |
define | MIN_KEYMAP_INDEX 0 |
define | ROW_COUNT 5 |
define | SCL 10 |
define | SDA 2 |
Detailed Description
Author:
hreikin (hreikin@gmail.com) @license MIT
Copyright:
Copyright (c) 2025 hreikin (hreikin@gmail.com)
Date:
2025-03-07
Public Types Documentation
enum KeyState
Public Attributes Documentation
variable altLock
variable backlightState
variable capsLock
variable cols
variable ctrlLock
variable currentBrightness
variable defaultKeymap
variable emptyData
variable keyInfo
variable keyRepeatStart
variable keyStates
variable keymapIndex
variable lastValue
variable rows
variable sendData
variable sendDataFlag
variable symbolKeymap1
variable symbolKeymap2
variable symbolKeymap3
variable symbolKeymap4
variable symbolKeymap5
variable symbolKeymap6
variable symbolKeymap7
variable symbolLock
Public Functions Documentation
function autoResetKeymapIndex
Handles resetting the keymap index.
function doesKeyExistInKeymap
Checks if a key exists in the keymap.
Parameters:
rowIndex
The row index of the key.colIndex
The column index of the key.keymap
The keymap to check.
Returns:
true if the key exists in the keymap, false otherwise.
function handleCharacter
Handles the character for a specific key.
Parameters:
rowIndex
The row index of the key.colIndex
The column index of the key.
function keyHeld
Checks if a key is being held.
Parameters:
rowIndex
The row index of the key.colIndex
The column index of the key.
Returns:
true if the key is being held, false otherwise.
function keyNotPressed
Checks if a key is not pressed.
Parameters:
rowIndex
The row index of the key.colIndex
The column index of the key.
Returns:
true if the key is not pressed, false otherwise.
function keyPressed
Checks if a key was pressed.
Parameters:
rowIndex
The row index of the key.colIndex
The column index of the key.
Returns:
true if the key was pressed, false otherwise.
function keyReleased
Checks if a key was released.
Parameters:
rowIndex
The row index of the key.colIndex
The column index of the key.
Returns:
true if the key was released, false otherwise.
function onRequest
Handles I2C requests.
Sends the key data over I2C when requested.
function printKeyInfo
Prints the key information.
Parameters:
data
The key data array.
function readKeyMatrix
Reads the key matrix and updates the key states.
function sendKeyInfo
Sends the key information over I2C.
function setDefaultCharacter
Sets keyInfo to the correct character for a specific key, from the default keymap only.
Parameters:
rowIndex
The row index of the key.colIndex
The column index of the key.
Sets keyInfo to the correct character for a specific key, from the default keymap only.
Parameters:
rowIndex
The row index of the key.colIndex
The column index of the key.
function setKeyboardBrightness
Sets the keyboard backlight brightness.
Parameters:
command
The command to set the brightness (toggle, up, down).
function setSymbolCharacter
Sets keyInfo to the correct character for a specific key, from the symbol keymaps only.
Parameters:
rowIndex
The row index of the key.colIndex
The column index of the key.
Sets keyInfo to the correct character for a specific key, from the symbol keymaps only.
Parameters:
rowIndex
The row index of the key.colIndex
The column index of the key.
Macro Definition Documentation
define COL_COUNT
define DEBOUNCE_DELAY
define FUNCTION_DOWN
define FUNCTION_TOGGLE
define FUNCTION_UP
define I2C_DEV_ADDR
define KEYBOARD_BACKLIGHT_PIN
define KEYBOARD_BRIGHTNESS_CH
define KEYBOARD_BRIGHTNESS_DEFAULT
define KEYBOARD_BRIGHTNESS_FREQ
define KEYBOARD_BRIGHTNESS_MAX
define KEYBOARD_BRIGHTNESS_MIN
define KEYBOARD_BRIGHTNESS_RES
define KEYBOARD_BRIGHTNESS_STEP
define KEY_INFO_SIZE
define KEY_REPEAT_DELAY
define MAX_KEYMAP_INDEX
define MIN_KEYMAP_INDEX
define ROW_COUNT
define SCL
define SDA
The documentation for this class was generated from the following file keyboard/keyboard.hpp