| 742 | } |
| 743 | |
| 744 | bool ApplyDefaultXInputBindings() |
| 745 | { |
| 746 | if (!OisGamepad) |
| 747 | return false; |
| 748 | |
| 749 | for (int i = 0; i < (int)ActionID::Count; i++) |
| 750 | { |
| 751 | auto actionID = (ActionID)i; |
| 752 | |
| 753 | int defaultKeyID = g_Bindings.GetBoundKeyID(BindingProfileID::Default, actionID); |
| 754 | int userKeyID = g_Bindings.GetBoundKeyID(BindingProfileID::Custom, actionID); |
| 755 | |
| 756 | if (userKeyID != OIS::KC_UNASSIGNED && |
| 757 | userKeyID != defaultKeyID) |
| 758 | { |
| 759 | return false; |
| 760 | } |
| 761 | } |
| 762 | |
| 763 | auto vendor = ToLower(OisGamepad->vendor()); |
| 764 | if (vendor.find("xbox") != std::string::npos || vendor.find("xinput") != std::string::npos) |
| 765 | { |
| 766 | ApplyBindings(DEFAULT_GAMEPAD_BINDING_PROFILE); |
| 767 | g_Configuration.Bindings = g_Bindings.GetBindingProfile(BindingProfileID::Custom); |
| 768 | |
| 769 | // Additionally enable rumble and thumbstick camera. |
| 770 | g_Configuration.EnableRumble = true; |
| 771 | g_Configuration.EnableThumbstickCamera = true; |
| 772 | |
| 773 | return true; |
| 774 | } |
| 775 | else |
| 776 | { |
| 777 | return false; |
| 778 | } |
| 779 | } |
| 780 | |
| 781 | Vector2 GetMouse2DPosition() |
| 782 | { |
no test coverage detected