diff --git a/src/frontend/gui/controls.cpp b/src/frontend/gui/controls.cpp index 295073e5..8b4935cb 100644 --- a/src/frontend/gui/controls.cpp +++ b/src/frontend/gui/controls.cpp @@ -179,7 +179,7 @@ void InputBindBox::drawBackground(Batch2D* batch, Assets* assets) { } void InputBindBox::clicked(GUI*, int button) { - binding.type = inputtype::button; + binding.type = inputtype::mouse; binding.code = button; defocus(); } diff --git a/src/voxel_engine.cpp b/src/voxel_engine.cpp index 7f0f882e..00203474 100644 --- a/src/voxel_engine.cpp +++ b/src/voxel_engine.cpp @@ -49,7 +49,7 @@ std::string write_controls() { json::JObject* jentry = new json::JObject(); switch (binding.type) { case inputtype::keyboard: jentry->put("type", "keyboard"); break; - case inputtype::button: jentry->put("type", "button"); break; + case inputtype::mouse: jentry->put("type", "mouse"); break; default: throw std::runtime_error("unsupported control type"); } jentry->put("code", binding.code); @@ -72,8 +72,8 @@ void load_controls(std::string filename, std::string source) { if (typestr == "keyboard") { type = inputtype::keyboard; - } else if (typestr == "button") { - type = inputtype::button; + } else if (typestr == "mouse") { + type = inputtype::mouse; } else { std::cerr << "unknown input type '" << typestr << "'" << std::endl; continue; diff --git a/src/window/Events.cpp b/src/window/Events.cpp index ec5fb3f9..6bbc7f63 100644 --- a/src/window/Events.cpp +++ b/src/window/Events.cpp @@ -73,7 +73,7 @@ void Events::pullEvents(){ bool newstate = false; switch (binding.type) { case inputtype::keyboard: newstate = pressed(binding.code); break; - case inputtype::button: newstate = clicked(binding.code); break; + case inputtype::mouse: newstate = clicked(binding.code); break; } if (newstate) { diff --git a/src/window/input.h b/src/window/input.h index 33469fdc..ef5840ba 100644 --- a/src/window/input.h +++ b/src/window/input.h @@ -80,7 +80,7 @@ namespace mousecode { enum class inputtype { keyboard, - button, + mouse, }; struct Binding { @@ -100,7 +100,7 @@ struct Binding { const char* text() const { switch (type) { case inputtype::keyboard: return keycode::name(code); - case inputtype::button: return mousecode::name(code); + case inputtype::mouse: return mousecode::name(code); } return ""; }