lib/ruco/keyboard.rb in ruco-0.2.13 vs lib/ruco/keyboard.rb in ruco-0.2.14
- old
+ new
@@ -105,11 +105,11 @@
end
end
def self.fetch_user_input
key = @input.call or return
- key = key.ord if key.is_a?(String) # ruby 1.9 fix
+ key = key.ord unless IS_18
if key >= NOTHING
# nothing happening -> sleep a bit to save cpu
sleep SEQUENCE_TIMEOUT
return
end
@@ -177,10 +177,10 @@
end
end
end
def self.escape_sequence?(sequence)
- sequence[0] == ESCAPE and sequence.size.between?(2,7) # Esc
+ sequence[0] == ESCAPE and sequence.size.between?(2,7)
end
def self.is_alt_key_code?(sequence)
sequence.slice(0,1) == "^" and sequence.size == 2
end