Skip to content

Commit

Permalink
Minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bendahl committed Mar 30, 2018
1 parent fdd6f63 commit ae34c19
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions uinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ func (vTouch vTouchPad) RightClick() error {
}
return nil
}

// LeftPress will simulate a press of the left mouse button. Note that the button will not be released until
// LeftRelease is invoked.
func (vTouch vTouchPad) LeftPress() error {
Expand Down Expand Up @@ -270,12 +271,12 @@ func (vTouch vTouchPad) LeftRelease() error {

// RightPress will simulate the press of the right mouse button. Note that the button will not be released until
// RightRelease is invoked.
func (vRel vTouchPad) RightPress() error {
err := sendBtnEvent(vRel.deviceFile, evBtnRight, btnStatePressed)
func (vTouch vTouchPad) RightPress() error {
err := sendBtnEvent(vTouch.deviceFile, evBtnRight, btnStatePressed)
if err != nil {
return fmt.Errorf("Failed to press the right mouse button: %v", err)
}
err = syncEvents(vRel.deviceFile)
err = syncEvents(vTouch.deviceFile)
if err != nil {
return fmt.Errorf("sync to device file failed: %v", err)
}
Expand Down

0 comments on commit ae34c19

Please sign in to comment.