You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
607 B
Lua
21 lines
607 B
Lua
local base = string.match(..., "(.-)[^%.]+%.[^%.]+$")
|
|
local ffi = require("ffi")
|
|
local fh = require(base.."helper.ffi_struct")
|
|
|
|
local format = string.format
|
|
|
|
local mt, index = {}, {}
|
|
|
|
-- is this an enum of BTN or just some random index?
|
|
-- Looks like this whole trigger shit is only used by some iforce devices
|
|
fh.gen_raw_accessor(index, "button")
|
|
fh.gen_raw_accessor(index, "interval")
|
|
|
|
function index:tostring()
|
|
return format("ff_trigger{button=%d, interval=%d}",
|
|
self.button, self.interval)
|
|
end
|
|
mt.__tostring = index.tostring
|
|
|
|
return fh.base(mt, index, ffi.typeof("struct ff_trigger"))
|