Skip to content

Commit

Permalink
Rename 'id' => 'fd' to improve self documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ghthor committed Aug 30, 2016
1 parent 2b9c3e7 commit c70a206
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions uinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type Keyboard interface {

type vKeyboard struct {
name string
id int
fd int
}

func CreateKeyboard(path, name string) (Keyboard, error) {
Expand All @@ -57,17 +57,17 @@ func CreateKeyboard(path, name string) (Keyboard, error) {
}

func (vk vKeyboard) SendKeyPress(key int) error {
return sendBtnEvent(vk.id, key, 1)
return sendBtnEvent(vk.fd, key, 1)
}

func (vk vKeyboard) SendKeyRelease(key int) error {
return sendBtnEvent(vk.id, key, 0)
return sendBtnEvent(vk.fd, key, 0)
}

// Close will close the device and free resources.
// It's usually a good idea to use defer to call this function.
func (vk vKeyboard) Close() error {
return closeDevice(vk.id)
return closeDevice(vk.fd)
}

func createVKeyboardDevice(path, name string) (deviceId int, err error) {
Expand Down

0 comments on commit c70a206

Please sign in to comment.