inputor

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

ff_replay.lua (453B)


      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 fh.gen_raw_accessor(index, "length")
     10 fh.gen_raw_accessor(index, "delay")
     11 
     12 function index:tostring()
     13   return format("ff_replay{length=%d, delay=%d}", self.length, self.delay)
     14 end
     15 mt.__tostring = index.tostring
     16 
     17 return fh.base(mt, index, ffi.typeof("struct ff_replay"))