21 device_ = os::gamepad::open_device(index_);
25 name_ = os::gamepad::get_device_name(device_);
35 os::gamepad::close_device(device_);
44 refresh_device_ =
true;
61 refresh_device_ =
false;
66 button_state_map_.
clear();
73 button_state_map_.
update();
75 uint32_t buttons_count = os::gamepad::get_buttons_count(device_);
76 for(uint32_t
b = 0;
b < buttons_count; ++
b)
78 auto state = os::gamepad::get_button_state(device_,
b);
81 if(state == os::gamepad::button_state::pressed)
89 uint32_t axis_count = os::gamepad::get_axis_count(device_);
90 for(
int a = 0;
a < axis_count; ++
a)
92 float normalized = os::gamepad::get_axis_value_normalized(device_,
a);
94 axis_map_[
a] = normalized;
101 if(!is_input_allowed())
105 auto it = axis_map_.find(
axis);
106 if(it == axis_map_.end())
129 return os::gamepad::is_device_connected(device_);
135 if(!is_input_allowed())
145 if(!is_input_allowed())
154 if(!is_input_allowed())
#define APPLOG_WARNING(...)
Hash specialization for batch_key to enable use in std::unordered_map.