feat: ipc events for cursor shake

ref #3
This commit is contained in:
Virt 2024-06-28 18:03:59 +02:00
commit fcb4c2b87b
5 changed files with 34 additions and 3 deletions

View file

@ -1,6 +1,10 @@
#include <hyprutils/math/Vector2D.hpp>
#include <vector>
#define IPC_SHAKE_START "shakestart"
#define IPC_SHAKE_UPDATE "shakeupdate"
#define IPC_SHAKE_END "shakeend"
using namespace Hyprutils::Math;
class CShake {
@ -9,8 +13,8 @@ class CShake {
double update(Vector2D pos);
private:
/* tracks the global software lock issued by cursor shaking */
bool software = false;
/* tracks whether the current shake has already been announced in the ipc */
bool ipc = false;
/* ringbuffer for last samples */
std::vector<Vector2D> samples;