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 33
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 39
def button=(button)
  @button = button
  refresh
end
refresh() click to toggle source
# File lib/net/vnc.rb, line 51
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 44
def update(x, y, button = @button)
  @x = x
  @y = y
  @button = button
  refresh
end