#include "../parser/toml_parser.hpp"
#include <cstdlib>
#include <iostream>
#include <string_view>
#include <unordered_map>
Go to the source code of this file.
Classes | |
struct | Keybinds |
Struct to hold keybinding mappings. More... | |
Functions | |
Keybinds | parseKeybinds () |
Parses the keybinds from the TOML configuration. | |
Keybinds parseKeybinds | ( | ) |
Parses the keybinds from the TOML configuration.
This function reads the keybind configurations from the TOML file, maps them to their respective key values, and returns a populated Keybinds
struct.
Keybinds
struct with the key mappings for various actions. < Special key for Tab
< Special key for Space
< Special key for Enter
< Special key for Escape
Reports an error for unsupported or empty keybind.
This lambda function prints an error message and terminates the program if an unsupported or empty keybind is detected in the configuration.
field | The field in which the invalid keybind was found. |
key | The keybind that was invalid or empty. |
< Exit the program on invalid keybind
Handles the mapping of special keys and single-character keys.
This lambda function checks whether a keybind is a special key (e.g., Tab, Enter) or a single character, and returns the corresponding ASCII value. It reports an error if the key is invalid or unsupported.
key | The keybind to be processed. |
field | The field name that the keybind belongs to. |
< Report error if key is empty
< Return the mapped special key
< Report error if the key is not supported
< Handle each keybind
< Return the populated Keybinds struct