We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent adfcb83 commit 7882f5fCopy full SHA for 7882f5f
2 files changed
processing_app/library/library_proxy/library/mouse_thing/mouse_thing.rb
@@ -1,13 +1,23 @@
1
class MouseThing < LibraryProxy
2
+attr_reader :app, :count
3
+ def initialize(app)
4
+ @app = app
5
+ @count = 0
6
+ end
7
+
8
def draw
9
end
10
11
def mouseEvent(event)
12
case event.action
13
when MouseEvent::CLICK
- puts 'CLICK'
14
+ # puts 'CLICK'
15
+ app.send :puts, event.toString
16
when MouseEvent::DRAG
17
puts 'DRAG'
18
+ when MouseEvent::WHEEL
19
+ @count += event.getCount
20
+ puts count
21
22
23
processing_app/library/library_proxy/mouse_event_demo.rb
@@ -1,14 +1,14 @@
load_libraries :library_proxy, :mouse_thing
-attr_reader :mouseThing
+attr_reader :mouse_proxy
def settings
size(800, 600)
def setup
sketch_title 'Mouse Event'
- frameRate(1)
+ frame_rate(1)
MouseThing.new(self)
0 commit comments