Skip to content

Instantly share code, notes, and snippets.

@Newlifer
Created July 18, 2017 11:28
Show Gist options
  • Save Newlifer/5a61575bfc4f2402bc52c60d6fb6fbff to your computer and use it in GitHub Desktop.
Save Newlifer/5a61575bfc4f2402bc52c60d6fb6fbff to your computer and use it in GitHub Desktop.
keymap.hpp
#pragma once
#include "hashmap.hpp"
#define UNKNOWN_PLATFORM "Unknown platform!"
namespace aim {
enum class VKey : int {
K_Esc,
K_1,
K_2,
K_3,
K_4,
K_5,
K_6
};
static const hash_map<int, VKey> key_map = {
#ifdef __linux__
{1, Vkey.K_Esc},
#elif _WIN32
{1, Vkey.K_Esc},
#else
#error UNKNOWN_PLATFORM
#endif
#ifdef __linux__
{2, Vkey.K_1},
#elif _WIN32
{2, Vkey.K_1},
#else
#error UNKNOWN_PLATFORM
#endif
#ifdef __linux__
{3, Vkey.K_3},
#elif _WIN32
{3, Vkey.K_3},
#else
#error UNKNOWN_PLATFORM
#endif
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment