Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/net/vnc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def type text, options={}
packet = 0.chr * 8
packet[0] = 4.chr
text.split(//).each do |char|
packet[7] = char[0]
packet[7] = char.ord.chr
packet[1] = 1.chr
socket.write packet
packet[1] = 0.chr
Expand Down Expand Up @@ -178,11 +178,11 @@ def key_press(*args)
end

def get_key_code which
if String === which
if which.class == String
if which.length != 1
raise ArgumentError, 'can only get key_code of single character strings'
end
which[0]
which[0].ord
else
KEY_MAP[which]
end
Expand Down Expand Up @@ -292,7 +292,7 @@ def packet_reading_thread
begin
break if @packet_reading_state != :loop
next unless IO.select [socket], nil, nil, 2
type = socket.read(1)[0]
type = socket.read(1).ord
read_packet type
rescue
warn "exception in packet_reading_thread: #{$!.class}:#{$!}"
Expand Down