inputor

Evdev remapping utility in lua
git clone https://git.neptards.moe/u3shit/inputor.git
Log | Files | Refs

ff_trigger.lua (607B)


      1 local base = string.match(..., "(.-)[^%.]+%.[^%.]+$")
      2 local ffi = require("ffi")
      3 local fh = require(base.."helper.ffi_struct")
      4 
      5 local format = string.format
      6 
      7 local mt, index = {}, {}
      8 
      9 -- is this an enum of BTN or just some random index?
     10 -- Looks like this whole trigger shit is only used by some iforce devices
     11 fh.gen_raw_accessor(index, "button")
     12 fh.gen_raw_accessor(index, "interval")
     13 
     14 function index:tostring()
     15   return format("ff_trigger{button=%d, interval=%d}",
     16                 self.button, self.interval)
     17 end
     18 mt.__tostring = index.tostring
     19 
     20 return fh.base(mt, index, ffi.typeof("struct ff_trigger"))