22 lines
461 B
Lua
22 lines
461 B
Lua
function kbd(kA,sI)
|
|
spawn("kbd: "..kA:sub(1,8),function()
|
|
while true do
|
|
local _,ka,c,C = event.pull("key_down")
|
|
if c == 18 and C == 19 then computer.shutdown(true) end
|
|
if ka == kA then
|
|
event.push("key",sI,c,C)
|
|
end
|
|
end
|
|
end)
|
|
spawn("kbd-clipboard: "..kA:sub(1,8),function()
|
|
while true do
|
|
local _,ka,s = event.pull("clipboard")
|
|
if ka == kA then
|
|
for c in s:gmatch(".") do
|
|
event.push("key",sI,string.byte(c),0)
|
|
end
|
|
end
|
|
end
|
|
end)
|
|
end
|