# \[Linux\] only receiving 1365 events when reading from /dev/input

**URL:** https://discourse.julialang.org/t/linux-only-receiving-1365-events-when-reading-from-dev-input/97886
**Category:** General Usage
**Tags:** linux, io
**Created:** [April 25, 2023, 5:39am UTC](https://discourse.julialang.org/t/linux-only-receiving-1365-events-when-reading-from-dev-input/97886 "2023-04-25T05:39:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![screw\_dog](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/screw_dog/32/48119_2.png) [@screw\_dog](https://discourse.julialang.org/u/screw_dog)
#### Post date: [April 25, 2023, 5:39am UTC](https://discourse.julialang.org/t/linux-only-receiving-1365-events-when-reading-from-dev-input/97886/1 "2023-04-25T05:39:03Z")

</div>

I’m trying to read keyboard input events from `dev/input/eventN`, but after reading exactly 1365 events the file is reported as empty and never receives any more data. MWE:

```julia
dev_num = 6 # my keyboard is event6, use `cat /proc/bus/input/devices` to find yours
kbd = open("/dev/input/event$dev_num", "r")
num_events = 0; event = zeros(UInt8, 24);
while !eof(kbd)
    num_events += 1
    readbytes!(kbd, event; all=true)
end
num_events
eof(kbd)
close(kbd)

```

By typing the lines after the `while` loop we should have more events to read but `eof` is always true for me and `num_events` is always 1365.

Not sure if this is a problem with Julia’s I/O but any help would be appreciated.

Note: all my programs work fine so the keyboard events are being received by elsewhere. Also, this works fine for `/dev/input/mouse0` or `/dev/input/mice`.

Also, this approach seems to work fine for [`logkeys.cc` - read](https://github.com/kernc/logkeys/blob/master/src/logkeys.cc#L423) which makes me suspect either I’m doing something wrong here or Julia is.
