make states numbers instead of booleans
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
|
||||
local function queueBit(gate, bit)
|
||||
table.insert(gate.queueBits, 1, bit)
|
||||
end
|
||||
|
||||
return function(gate, argv)
|
||||
if argv[1]=="\\:" then argv[1] = ";" end
|
||||
|
||||
@@ -7,18 +11,14 @@ return function(gate, argv)
|
||||
|
||||
local code = keycode+(status and 128 or 0)
|
||||
|
||||
local function queueBit(bit)
|
||||
table.insert(gate.queueBits, 1, bit)
|
||||
end
|
||||
|
||||
queueBit(true)
|
||||
queueBit(gate, 1)
|
||||
for bitidx = 1, 8 do
|
||||
local val = bit.band(code, 0x80)~=0
|
||||
queueBit(val)
|
||||
local val = bit.band(code, 0x80)
|
||||
queueBit(gate, val)
|
||||
|
||||
code = bit.lshift(code, 1)
|
||||
end
|
||||
queueBit(false)
|
||||
queueBit(gate, 0)
|
||||
|
||||
Gate.queue(gate, 0)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user