Class: Revdev::EventDevice

Inherits:
Object
  • Object
show all
Defined in:
lib/fusuma/plugin/remap/uinput_touchpad.rb

Instance Method Summary collapse

Instance Method Details

#absinfo_for_axis(abs) ⇒ Object



154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/fusuma/plugin/remap/uinput_touchpad.rb', line 154

def absinfo_for_axis(abs)
  data = read_ioctl_with(eviocgabs(abs))

  {
    value: data[0, 4].unpack1("l<"),
    absmin: data[4, 4].unpack1("l<"),
    absmax: data[8, 4].unpack1("l<"),
    absfuzz: data[12, 4].unpack1("l<"),
    absflat: data[16, 4].unpack1("l<"),
    resolution: data[20, 4].unpack1("l<")
  }
end

#eviocgabs(abs) ⇒ Object

FIXME: undefined constants in revdev



168
169
170
171
# File 'lib/fusuma/plugin/remap/uinput_touchpad.rb', line 168

def eviocgabs(abs)
  # #define EVIOCGABS(abs)	_IOR('E', 0x40 + abs, struct input_absinfo)
  0x80404540 + abs # EVIOCGABS(abs)
end