mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-20 00:23:22 +02:00
feat: tilting simulation mode
This commit is contained in:
parent
6a1d3e68c9
commit
416f6efc2f
5 changed files with 169 additions and 21 deletions
|
@ -10,6 +10,8 @@ class CDynamicCursors {
|
|||
public:
|
||||
/* hook on onCursorMoved */
|
||||
void onCursorMoved(CPointerManager* pointers);
|
||||
/* called on tick */
|
||||
void onTick(CPointerManager* pointers);
|
||||
|
||||
/* hook on renderSoftwareCursorsFor */
|
||||
void renderSoftware(CPointerManager* pointers, SP<CMonitor> pMonitor, timespec* now, CRegion& damage, std::optional<Vector2D> overridePos);
|
||||
|
@ -24,10 +26,19 @@ class CDynamicCursors {
|
|||
// current angle of the cursor in radiants
|
||||
double angle;
|
||||
|
||||
// calculates the current angle of the cursor, returns whether the angle has changed
|
||||
bool calculate(Vector2D* pos);
|
||||
// calculates the current angle of the cursor, and changes the cursor shape
|
||||
void calculate();
|
||||
|
||||
// calculate the angle of the cursor if stick
|
||||
double calculateStick();
|
||||
// this is the end of the virtual stick
|
||||
Vector2D end;
|
||||
|
||||
// calculate the angle of the cursor if air
|
||||
double calculateAir();
|
||||
// ring buffer of last position samples
|
||||
std::vector<Vector2D> samples;
|
||||
int samples_index = 0;
|
||||
};
|
||||
|
||||
inline std::unique_ptr<CDynamicCursors> g_pDynamicCursors;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue