kaspergrubbe / ruby-vnc

A library for interaction automation of servers via VNC
MIT License
31 stars 17 forks source link

bugfix get_key_code() returns ASCII CODE as RFB key code #14

Closed lobin-z0x50 closed 6 years ago

lobin-z0x50 commented 6 years ago

Hi, I try use this OSS for my product.

But I got Type Error using key_down 'a'.

sample code:

require 'net/vnc'
Net::VNC.open 'localhost:2', :shared => true, :password => 'matzisnicesowearenice' do |vnc|
  key_down 'a'
  key_up 'a'
end

result:

Traceback (most recent call last):
        4: from aaa.rb:2:in `<main>'
        3: from /usr/local/var/rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/ruby-vnc-1.1.0/lib/net/vnc.rb:92:in `open'
        2: from aaa.rb:5:in `block in <main>'
        1: from /usr/local/var/rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/ruby-vnc-1.1.0/lib/net/vnc.rb:196:in `key_down'
/usr/local/var/rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/ruby-vnc-1.1.0/lib/net/vnc.rb:196:in `pack': no implicit conversion of String into Integer (TypeError)
aquasync commented 6 years ago

Looks fine to me - guess this is among the things that never got properly fixed for 1.9.