lib/fusuma.rb in fusuma-0.1.8 vs lib/fusuma.rb in fusuma-0.1.9
- old
+ new
@@ -40,12 +40,13 @@
end
private
def libinput_command
+ # NOTE: --enable-dwt means "disable while typing"
@libinput_command ||= "stdbuf -oL -- libinput-debug-events --device \
- /dev/input/#{device_name}"
+ /dev/input/#{device_name} --enable-dwt"
MultiLogger.debug(libinput_command: @libinput_command)
@libinput_command
end
def device_name
@@ -70,24 +71,24 @@
return false if line =~ %r{n/a}
true
end
def trigger_keyevent(gesture_info)
- case gesture_info.action
+ case gesture_info.action_type
when 'swipe'
- swipe(gesture_info.finger, gesture_info.direction.move)
+ swipe(gesture_info.finger, gesture_info.direction)
when 'pinch'
- pinch(gesture_info.direction.pinch)
+ pinch(gesture_info.direction)
end
end
def swipe(finger, direction)
shortcut = event_map['swipe'][finger.to_i][direction]['shortcut']
`xdotool key #{shortcut}` unless shortcut.nil?
end
- def pinch(zoom)
- shortcut = event_map['pinch'][zoom]['shortcut']
+ def pinch(direction)
+ shortcut = event_map['pinch'][direction]['shortcut']
`xdotool key #{shortcut}` unless shortcut.nil?
end
def event_map
@event_map ||= YAML.load_file(config_file)