Skip to content

Commit 9f65f7d

Browse files
committed
docs: remove manual sleeps
1 parent 288a2dc commit 9f65f7d

2 files changed

Lines changed: 1 addition & 12 deletions

File tree

types/device.d.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ function Device:events() end
226226
---@nodiscard
227227
function Device:read() end
228228

229+
---
229230
---Drain queued events and return how many were discarded.
230231
---
231232
---This is useful after grabbing a device when you want to ignore any stale
@@ -236,8 +237,6 @@ function Device:read() end
236237
---local dev = assert(Device("/dev/input/eventX"))
237238
---
238239
---assert(dev:grab())
239-
---os.execute("sleep 3")
240-
---
241240
----- Move the mouse or press keys during the sleep.
242241
---
243242
---local dropped = assert(dev:flush())

types/uinput.d.lua

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ local M = {}
2424
---local UInput = evdev.uinput.create
2525
---local ui = assert(UInput())
2626
---
27-
----- Give the system a moment to notice the new virtual device.
28-
----- Replace this with your preferred sleep helper.
29-
---os.execute("sleep 0.5")
30-
---
3127
---ui:emit(evdev.ecodes.EV_KEY, evdev.ecodes.KEY_A, 1)
3228
---ui:emit(evdev.ecodes.EV_KEY, evdev.ecodes.KEY_A, 0)
3329
---ui:sync()
@@ -98,10 +94,6 @@ function UInput:is_open() end
9894
---local UInput = evdev.uinput.create
9995
---local ui = assert(UInput())
10096
---
101-
----- Give the system a moment to notice the new virtual device.
102-
----- Replace this with your preferred sleep helper.
103-
---os.execute("sleep 0.5")
104-
---
10597
---local EV_KEY = evdev.ecodes.EV_KEY
10698
---ui:emit(EV_KEY, evdev.ecodes.KEY_A, 1)
10799
---ui:emit(EV_KEY, evdev.ecodes.KEY_A, 0)
@@ -143,7 +135,6 @@ function UInput:sync() end
143135
---```lua
144136
---local UInput = evdev.uinput.create
145137
---local ui = assert(UInput())
146-
---os.execute("sleep 0.5")
147138
---
148139
----- Set repeat delay to 500ms, repeat period to 50ms
149140
---ui:set_repeat(500, 50)
@@ -161,7 +152,6 @@ function UInput:set_repeat(delay, period) end
161152
---```lua
162153
---local UInput = evdev.uinput.create
163154
---local ui = assert(UInput())
164-
---os.execute("sleep 0.5")
165155
---
166156
---local delay, period, err = ui:get_repeat()
167157
---assert(delay, err)

0 commit comments

Comments
 (0)