Skip to content

Commit 0b3bf97

Browse files
committed
Mouse wheel
1 parent 99d38de commit 0b3bf97

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

Simulator/include/IbInputSimulator/SendTypes/Logitech.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ namespace Send::Type::Internal {
224224
};
225225
int8_t x;
226226
int8_t y;
227-
Byte unknown_W; //#TODO: Wheel?
227+
Byte wheel;
228228
Byte unknown_T; //#TODO: T?
229229
private:
230230
void assert_size() {
@@ -323,6 +323,10 @@ namespace Send::Type::Internal {
323323
mouse_report.y = 0;
324324
}
325325

326+
if (mi.dwFlags & MOUSEEVENTF_WHEEL) { // TODO MOUSEEVENTF_HWHEEL
327+
mouse_report.wheel = std::bit_cast<int32_t>(mi.mouseData) > 0 ? 1 : -1;
328+
}
329+
326330
#define CODE_GENERATE(down, up, member) \
327331
if (mi.dwFlags & down || mi.dwFlags & up) \
328332
mouse_report.button.##member = mi.dwFlags & down;
@@ -389,7 +393,7 @@ namespace Send::Type::Internal {
389393
};
390394
int16_t x;
391395
int16_t y;
392-
Byte unknown_W; //#TODO: Wheel?
396+
Byte wheel;
393397
Byte unknown_T; //#TODO: T?
394398
private:
395399
void assert_size() {

Simulator/include/IbInputSimulator/SendTypes/Razer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ namespace Send::Type::Internal {
140140
control.mi.ButtonFlags |= MOUSE_WHEEL;
141141
else
142142
control.mi.ButtonFlags |= MOUSE_HWHEEL;
143-
control.mi.ButtonData = 120 * std::bit_cast<int32_t>(mi.mouseData); //#TODO
143+
control.mi.ButtonData = std::bit_cast<int32_t>(mi.mouseData);
144144
}
145145

146146
if constexpr (debug)

0 commit comments

Comments
 (0)