Enable axis in virtual_input device only when needed

This commit is contained in:
max
2020-12-21 11:47:25 +01:00
parent ffcfb3da82
commit 1f02882971
3 changed files with 42 additions and 15 deletions
+3
View File
@@ -45,6 +45,7 @@ namespace logid
~InputDevice();
void registerKey(uint code);
void registerAxis(uint axis);
void moveAxis(uint axis, int movement);
void pressKey(uint code);
void releaseKey(uint code);
@@ -55,10 +56,12 @@ namespace logid
private:
void _sendEvent(uint type, uint code, int value);
void _enableEvent(uint type, uint name);
static uint _toEventCode(uint type, const std::string& name);
bool registered_keys[KEY_CNT];
bool registered_axis[REL_CNT];
libevdev* device;
libevdev_uinput* ui_device{};
};