Example #1
0
Hotkey::Hotkey(agi::fs::path const& file, std::pair<const char *, size_t> default_config)
: config_file(file)
{
	LOG_D("hotkey/init") << "Generating hotkeys.";

	const json::Object object(agi::json_util::file(config_file, default_config));
	for (auto const& hotkey_context : object)
		BuildHotkey(hotkey_context.first, hotkey_context.second);
}
Example #2
0
Hotkey::Hotkey(fs::path const& file, std::pair<const char *, size_t> default_config)
: config_file(file)
{
	LOG_D("hotkey/init") << "Generating hotkeys.";

	auto root = json_util::file(config_file, default_config);
	for (auto const& hotkey_context : static_cast<json::Object const&>(root))
		BuildHotkey(hotkey_context.first, hotkey_context.second);
	UpdateStrMap();
}