Method: Wads::TextField#button_down

Defined in:
lib/wads/textinput.rb

#button_down(id, mouse_x, mouse_y) ⇒ Object



100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/wads/textinput.rb', line 100

def button_down(id, mouse_x, mouse_y)
  if id == Gosu::MsLeft
    move_caret(mouse_x)
  else 
    if @old_value == self.text
      # nothing to do
    else 
      @old_value = self.text
      return WidgetResult.new(false, EVENT_TEXT_INPUT, [self.text])
    end
  end
end