inputor

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

ff_upload.lua (677B)


      1 local base = string.match(..., "(.-)[^%.]+%.[^%.]+$")
      2 local ff_effect = require(base.."ev_api.ff_effect").new
      3 local ffi = require("ffi")
      4 local fh = require(base.."helper.ffi_struct")
      5 
      6 local format = string.format
      7 
      8 local mt, index = {}, {}
      9 
     10 fh.gen_raw_accessor(index, "request_id")
     11 fh.gen_raw_accessor(index, "retval")
     12 fh.gen_wrap_accessor(index, "effect", ff_effect)
     13 fh.gen_wrap_accessor(index, "old", ff_effect)
     14 
     15 function index:tostring()
     16   return format(
     17     "ff_upload{request_id=%d, retval=%d, effect=%s, old=%s}",
     18     self.request_id, self.retval, self.effect, self.old)
     19 end
     20 mt.__tostring = index.tostring
     21 
     22 return fh.base(mt, index, ffi.typeof("struct uinput_ff_upload"))