mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-22 19:00:14 -05:00
input_common: Use accelerometer data for mapping
This commit is contained in:
parent
7116a7d28b
commit
4b4af29f86
1 changed files with 10 additions and 2 deletions
|
@ -298,8 +298,16 @@ void InputEngine::TriggerOnMotionChange(const PadIdentifier& identifier, int mot
|
||||||
if (!configuring || !mapping_callback.on_data) {
|
if (!configuring || !mapping_callback.on_data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (std::abs(value.gyro_x) < 0.6f && std::abs(value.gyro_y) < 0.6f &&
|
bool is_active = false;
|
||||||
std::abs(value.gyro_z) < 0.6f) {
|
if (std::abs(value.accel_x) > 1.5f || std::abs(value.accel_y) > 1.5f ||
|
||||||
|
std::abs(value.accel_z) > 1.5f) {
|
||||||
|
is_active = true;
|
||||||
|
}
|
||||||
|
if (std::abs(value.gyro_x) > 0.6f || std::abs(value.gyro_y) > 0.6f ||
|
||||||
|
std::abs(value.gyro_z) > 0.6f) {
|
||||||
|
is_active = true;
|
||||||
|
}
|
||||||
|
if (!is_active) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mapping_callback.on_data(MappingData{
|
mapping_callback.on_data(MappingData{
|
||||||
|
|
Loading…
Reference in a new issue