inputor

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

ff_erase.lua (552B)


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