summaryrefslogtreecommitdiffhomepage
path: root/test/controller.rb
blob: b4de79afc54979f84d2fa7df661f225a9767ddcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'ruby2d'

set title: "Ruby 2D — Controller", width: 300, height: 200

on :controller do |event|
  puts event
end

on :controller_axis do |event|
  puts "Axis: #{event.axis}, Value: #{event.value}"
end

on :controller_button_down do |event|
  puts "Button down: #{event.button}"
end

on :controller_button_up do |event|
  puts "Button up: #{event.button}"
end

show