Files
gKeyMapper/src/mappings.h
2026-10-17 02:57:21 +02:00

25 lines
740 B
C++

// gKeyMapper - reading and writing the mappings configuration file.
#ifndef GKEYMAPPER_MAPPINGS_H
#define GKEYMAPPER_MAPPINGS_H
#include <string>
#include <vector>
#include "keyrow.h"
namespace gkeymapper {
// Default config file: ~/.config/gKeyMapper/mappings.conf.
std::string default_config_path();
// Writes all rows as "G1=type:target" lines. Returns false on I/O error.
bool write_mappings(const std::string& path, const std::vector<KeyRow>& rows);
// Loads mappings from path into the rows' widgets. Missing/invalid lines are
// skipped; a missing file is reported and otherwise ignored.
void read_mappings(const std::string& path, const std::vector<KeyRow>& rows);
} // namespace gkeymapper
#endif // GKEYMAPPER_MAPPINGS_H