summaryrefslogtreecommitdiffhomepage
path: root/tests/input.rb
blob: 44e594dcd326cca1a03f536be76fa724f390bf5b (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 width: 200, height: 100, title: "Ruby 2D – Input"

on key: 'a' do
  puts "a key"
end

on key_down: 's' do
  puts "s key down"
end

on mouse: 'up' do
  puts "mouse up"
end

on mouse: 'down' do
  puts "mouse down"
end

show