inputor

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

ff_rumble_effect.lua (540B)


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