mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix linux compilation of previous commit
This commit is contained in:
parent
cab424a05e
commit
a0b6ddccf8
1 changed files with 5 additions and 4 deletions
|
|
@ -20,16 +20,17 @@ void Binding::reset(mousecode code) {
|
|||
|
||||
namespace input_util {
|
||||
|
||||
std::string to_string(keycode code) {
|
||||
std::string to_string(keycode code) {
|
||||
int icode_repr = static_cast<int>(code);
|
||||
#ifdef _WIN32
|
||||
char name[64];
|
||||
int result = GetKeyNameTextA(glfwGetKeyScancode(static_cast<int>(code)) << 16, name, 64);
|
||||
int result = GetKeyNameTextA(glfwGetKeyScancode(icode_repr) << 16, name, 64);
|
||||
if (result == NULL) return "Unknown";
|
||||
return std::string(name);
|
||||
#else
|
||||
const char* name = glfwGetKeyName(code, glfwGetKeyScancode(code));
|
||||
const char* name = glfwGetKeyName(icode_repr, glfwGetKeyScancode(icode_repr));
|
||||
if (name == nullptr) {
|
||||
switch (code) {
|
||||
switch (icode_repr) {
|
||||
case GLFW_KEY_TAB: return "Tab";
|
||||
case GLFW_KEY_LEFT_CONTROL: return "Left Ctrl";
|
||||
case GLFW_KEY_RIGHT_CONTROL: return "Right Ctrl";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue