Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (17 sloc) 385 Bytes
require 'gosu'
class KeyListenerExample < Gosu::Window
def initialize
super 640, 480
self.caption = "Keyboard Example"
@font = Gosu::Font.new(32, name: "Nimbus Mono L")
end
def button_up(key_id)
if key_id == Gosu::KbEscape then
self.close
end
end
def draw
@font.draw("Pressing <Escape> will close this window.", 40, 40, 0)
end
end
KeyListenerExample.new.show