lib/launchpad/interaction.rb in launchpad-0.2.1 vs lib/launchpad/interaction.rb in launchpad-0.2.2
- old
+ new
@@ -72,11 +72,11 @@
# the interaction was properly stopped via stop or close.
#
# Optional options hash:
#
# [<tt>:detached</tt>] <tt>true/false</tt>,
- # whether to detach the interaction, method is blocking when +false+
+ # whether to detach the interaction, method is blocking when +false+,
# optional, defaults to +false+
#
# Errors raised:
#
# [Launchpad::NoInputAllowedError] when input is not enabled on the interaction's device
@@ -88,10 +88,10 @@
}.merge(opts || {})
@active = true
@reader_thread ||= Thread.new do
begin
while @active do
- @device.read_pending_actions.each {|action| respond_to_action(action)}
+ @device.read_pending_actions.each {|action| Thread.new {respond_to_action(action)}}
sleep @latency unless @latency <= 0
end
rescue Portmidi::DeviceError => e
raise CommunicationError.new(e)
ensure
\ No newline at end of file