2023-12-16 17:36:57 +01:00
|
|
|
#pragma once
|
|
|
|
#include "Input.h"
|
2024-11-27 20:44:36 +01:00
|
|
|
class CombinedInput final : public Input {
|
2023-12-16 17:36:57 +01:00
|
|
|
public:
|
|
|
|
void combine(const Input &b) {
|
2024-04-28 02:11:51 +02:00
|
|
|
data.buttons_d |= b.data.buttons_d;
|
|
|
|
data.buttons_r |= b.data.buttons_r;
|
2023-12-16 17:36:57 +01:00
|
|
|
data.buttons_h |= b.data.buttons_h;
|
|
|
|
if (!data.touched) {
|
|
|
|
data.touched = b.data.touched;
|
|
|
|
}
|
|
|
|
if (!data.validPointer) {
|
|
|
|
data.validPointer = b.data.validPointer;
|
|
|
|
data.pointerAngle = b.data.pointerAngle;
|
|
|
|
data.x = b.data.x;
|
|
|
|
data.y = b.data.y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void reset() {
|
|
|
|
data = {};
|
|
|
|
}
|
|
|
|
};
|