21 lines
403 B
Lua
21 lines
403 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 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
|