Add alternate LED name field to KLM overlay type for regional key layouts

This commit is contained in:
Adam Honse
2023-09-05 13:33:48 -05:00
parent 3e5a29afb2
commit 08569476ae
9 changed files with 1377 additions and 1201 deletions

View File

@@ -67,6 +67,7 @@ enum KEYBOARD_OPCODE
KEYBOARD_OPCODE_INS_SHFT_ADJACENT = 3,
KEYBOARD_OPCODE_INSERT_ROW = 4,
KEYBOARD_OPCODE_REMOVE_ROW = 5,
KEYBOARD_OPCODE_ADD_ALT_NAME = 6,
};
typedef struct
@@ -76,6 +77,7 @@ typedef struct
std::uint8_t col;
unsigned int value;
const char* name;
const char* alt_name;
KEYBOARD_OPCODE opcode;
} keyboard_led;
@@ -120,6 +122,8 @@ public:
unsigned int GetKeyCount();
std::string GetKeyNameAt(unsigned int key_idx);
std::string GetKeyNameAt(unsigned int row, unsigned int col);
std::string GetKeyAltNameAt(unsigned int key_idx);
std::string GetKeyAltNameAt(unsigned int row, unsigned int col);
unsigned int GetKeyValueAt(unsigned int key_idx);
unsigned int GetKeyValueAt(unsigned int row, unsigned int col);
@@ -141,6 +145,7 @@ private:
void SwapKeys(std::vector<keyboard_led> keys);
void RemoveKey(keyboard_led keys);
void RemoveRow(std::uint8_t row);
void AddAltName(keyboard_led key);
KEYBOARD_LAYOUT layout;
KEYBOARD_SIZE physical_size;