Reformat input.cpp
This commit is contained in:
parent
d76f9b12a5
commit
d167471369
1 changed files with 70 additions and 71 deletions
|
@ -17,7 +17,8 @@ void input_system::update() {
|
|||
const auto& [x, y] = platform::get_cursor_position();
|
||||
auto& [oldX, oldY] = _last_cursor_position;
|
||||
|
||||
const auto [width, height] = platform::get_window_size(::engine->get_main_window());
|
||||
const auto [width, height] =
|
||||
platform::get_window_size(::engine->get_main_window());
|
||||
|
||||
float xDelta = (x - oldX) / (float)width;
|
||||
float yDelta = (y - oldY) / (float)height;
|
||||
|
@ -51,8 +52,7 @@ void input_system::update() {
|
|||
|
||||
if (binding.last_button == key) {
|
||||
binding.repeat = true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
binding.repeat = false;
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,8 @@ void input_system::add_binding(const std::string& name) {
|
|||
_input_bindings.push_back(data);
|
||||
}
|
||||
|
||||
void input_system::add_binding_button(const std::string& name, InputButton key, float value) {
|
||||
void input_system::add_binding_button(const std::string& name, InputButton key,
|
||||
float value) {
|
||||
for (auto& binding : _input_bindings) {
|
||||
if (binding.name == name)
|
||||
binding.buttons[key] = value;
|
||||
|
@ -165,9 +166,7 @@ void input_system::end_text_input() {
|
|||
platform::end_text_input();
|
||||
}
|
||||
|
||||
bool input_system::is_text_input() const {
|
||||
return _in_text_input;
|
||||
}
|
||||
bool input_system::is_text_input() const { return _in_text_input; }
|
||||
|
||||
bool input_system::get_allowable_text_button(unsigned int keycode) const {
|
||||
if (platform::get_keycode(InputButton::Backspace) == keycode)
|
||||
|
|
Reference in a new issue