File tree 2 files changed +13
-5
lines changed
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ MappableFAVHIDOutput::MappableFAVHIDOutput(uint8_t favhid_id)
21
21
: MappableFAVHIDOutput(std::make_shared<FAVHIDDevice>(favhid_id)) {
22
22
}
23
23
24
- static decltype (FAVHID::FAVJoyState2::Report::x) ConvertAxisValue(
24
+ static constexpr decltype (FAVHID::FAVJoyState2::Report::x) ConvertAxisValue(
25
25
Axis::Value input) {
26
26
int64_t value = input;
27
27
value -= Axis::MIN;
@@ -209,14 +209,21 @@ std::shared_ptr<OutputDevice> MappableFAVHIDOutput::getDevice() const {
209
209
210
210
ButtonSinkPtr MappableFAVHIDOutput::button (uint8_t id) const {
211
211
return [this , id](Button ::Value value) {
212
- p->mState .SetButton (id, value);
212
+ p->mState .SetButton (id - 1 , value);
213
213
p->mDevice ->set (p->mState );
214
214
};
215
215
}
216
216
217
+ static constexpr int8_t ConvertHatValue (Hat::Value value) {
218
+ if (value == Hat::CENTER) {
219
+ return 0b1111 ;
220
+ }
221
+ return value / 4500 ;
222
+ }
223
+
217
224
HatSinkPtr MappableFAVHIDOutput::hat (uint8_t id) const {
218
225
return [this , id](Hat::Value value) {
219
- p->mState .SetPOV (id, value);
226
+ p->mState .SetPOV (id - 1 , ConvertHatValue ( value) );
220
227
p->mDevice ->set (p->mState );
221
228
};
222
229
}
Original file line number Diff line number Diff line change 1
1
include (FetchContent)
2
2
find_package (Git)
3
+
4
+ set (FAVHID_REVISION "12979fd7b6021975407a39080d13327504c878ba" )
3
5
FetchContent_Declare(
4
6
favhidclient
5
7
GIT_REPOSITORY https://github.com/fredemmott/favhid-client.git
6
8
GIT_TAG main
7
- UPDATE_COMMAND
8
- "${GIT_EXECUTABLE} " reset --hard e3d4f8a471c73ef7da3081544850b7604fb9c764
9
+ PATCH_COMMAND "${GIT_EXECUTABLE} " reset --hard "${FAVHID_REVISION} "
9
10
EXCLUDE_FROM_ALL
10
11
)
11
12
You can’t perform that action at this time.
0 commit comments