Skip to content

Commit

Permalink
Fixed linux issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-fiscaletti committed Oct 25, 2024
1 parent a2e2039 commit 234c706
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/keyboard/keyboard_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"time"

"github.com/nathan-fiscaletti/key-logger/pkg/keyboard/key"
"github.com/nathan-fiscaletti/key-logger/pkg/key"
)

const eventSize = 24 // Size of each event struct in bytes
Expand All @@ -27,12 +27,12 @@ func init() {
}

type keyboardLinux struct {
eventChan chan KeyboardEvent
eventChan chan Event
}

func (k keyboardLinux) Events(ctx context.Context) (chan KeyboardEvent, error) {
func (k keyboardLinux) Events(ctx context.Context) (chan Event, error) {
if k.eventChan == nil {
k.eventChan = make(chan KeyboardEvent)
k.eventChan = make(chan Event)

device, err := findKeyboardDevice()
if err != nil {
Expand Down Expand Up @@ -68,7 +68,7 @@ func (k keyboardLinux) Events(ctx context.Context) (chan KeyboardEvent, error) {
if event.Value == 1 {
eventType = KeyboardEventTypeDown
}
k.eventChan <- KeyboardEvent{
k.eventChan <- Event{
Key: key.FindKeyCode(uint32(event.Code)),
EventType: eventType,
Timestamp: time.Unix(int64(event.Time[0]), int64(event.Time[1])),
Expand Down

0 comments on commit 234c706

Please sign in to comment.