diff --git a/dxinput/touchpad.go b/dxinput/touchpad.go index 0563e01..212a6df 100644 --- a/dxinput/touchpad.go +++ b/dxinput/touchpad.go @@ -53,14 +53,18 @@ func NewTouchpad(id int32) (*Touchpad, error) { } func NewTouchpadFromDevInfo(dev *DeviceInfo) (*Touchpad, error) { - if dev == nil || dev.Type != DevTypeTouchpad { + if dev == nil || (dev.Type != DevTypeTouchpad && dev.Type != DevTypeMouse) { return nil, fmt.Errorf("Not a touchpad device(%d - %s)", dev.Id, dev.Name) } + isLibinputUsed := utils.IsPropertyExist(dev.Id, libinputPropTapEnabled) + if !isLibinputUsed && dev.Type == DevTypeMouse { + isLibinputUsed = utils.IsPropertyExist(dev.Id, libinputPropButtonScrollingButton) + } return &Touchpad{ Id: dev.Id, Name: dev.Name, - isLibinputUsed: utils.IsPropertyExist(dev.Id, libinputPropTapEnabled), + isLibinputUsed: isLibinputUsed, }, nil } diff --git a/dxinput/utils/list.c b/dxinput/utils/list.c index e36e1b6..0803a65 100644 --- a/dxinput/utils/list.c +++ b/dxinput/utils/list.c @@ -51,7 +51,8 @@ list_device(int* num) DeviceInfo* devs = NULL; for (i = 0; i < all_num; i++) { if ((xinfos[i].use != XISlavePointer && - xinfos[i].use != XISlaveKeyboard)) { + xinfos[i].use != XISlaveKeyboard && + xinfos[i].use != XIFloatingSlave)) { continue; }