Skip to content

Instantly share code, notes, and snippets.

@okyeron
Created January 24, 2019 17:37
Show Gist options
  • Save okyeron/c3a5af2c04d8daf32ef290fa9e7923f5 to your computer and use it in GitHub Desktop.
Save okyeron/c3a5af2c04d8daf32ef290fa9e7923f5 to your computer and use it in GitHub Desktop.
local keyb = hid.connect(1) -- connection is by vport number not device id
function init()
--tab.print(keyb)
-- print(" ")
--print(keyb.port .." " ..hid.devices[keyb.port].name)
print("List:")
tab.print(hid.list)
print(" ")
print("Devices:")
tab.print(hid.devices)
print(" ")
-- tab.print(hid.devices[1])
-- tab.print(hid.devices[2])
-- tab.print(hid.devices[3])
print(" ")
print("Code Tables:")
--tab.print(hid.devices[5].codes)
print(" ")
-- tab.print(hid.devices[1].types)
-- print("Dev 1 types:")
-- tab.print(hid.devices[1].types)
-- print("Dev 2 types:")
-- tab.print(hid.devices[2].types)
-- print("Dev 3 types:")
-- tab.print(hid.devices[3].types)
--print(" ")
--tab.print(hid.devices[2])
end
--
function keyb.event(typ, code, val)
print("hid.event ", typ, code, val)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment