class Net::VNC::PointerState

Attributes

button[R]
x[R]
y[R]

Public Class Methods

new(vnc) click to toggle source
# File lib/net/vnc.rb, line 34
def initialize vnc
  @x = @y = @button = 0
  @vnc = vnc
end

Public Instance Methods

button=(button) click to toggle source

could have the same for x=, and y=

# File lib/net/vnc.rb, line 40
def button= button
  @button = button
  refresh
end
refresh() click to toggle source
# File lib/net/vnc.rb, line 50
def refresh
  packet = 0.chr * 6
  packet[0] = 5.chr
  packet[1] = button.chr
  packet[2, 2] = [x].pack 'n'
  packet[4, 2] = [y].pack 'n'
  @vnc.socket.write packet
end
update(x, y, button=@button) click to toggle source
# File lib/net/vnc.rb, line 45
def update x, y, button=@button
  @x, @y, @button = x, y, button
  refresh
end