From 2ef27b71f1141cbcc38b63c448487e58e1546a39 Mon Sep 17 00:00:00 2001 From: Nathan Fiscaletti Date: Thu, 24 Oct 2024 12:17:09 -0500 Subject: [PATCH] fixed linux --- README.md | 2 +- pkg/keyboard/keyboard_linux.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 98be84d..36af360 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This is a simple implementation of a cross-platform key logger in Go. ## Supported Platforms - Windows -- Linux (code is untested) +- Linux ## Usage diff --git a/pkg/keyboard/keyboard_linux.go b/pkg/keyboard/keyboard_linux.go index e87c836..630fa3b 100644 --- a/pkg/keyboard/keyboard_linux.go +++ b/pkg/keyboard/keyboard_linux.go @@ -42,9 +42,10 @@ func (k keyboardLinux) Events(ctx context.Context) (chan KeyboardEvent, error) { if err != nil { return nil, err } - defer file.Close() go func() { + defer file.Close() + for { event := inputEvent{} buffer := make([]byte, eventSize)