|
|
@ -82,9 +82,9 @@ class Window < Gosu::Window |
|
|
|
@key_events[:down].delete(id) # when the key is released: stop holding it |
|
|
|
@key_events[:down].delete(id) # when the key is released: stop holding it |
|
|
|
@key_events[:up] << id # append the key event to the queue |
|
|
|
@key_events[:up] << id # append the key event to the queue |
|
|
|
|
|
|
|
|
|
|
|
if( @world && @world.controller ) then |
|
|
|
# if( @world && @world.controller ) then |
|
|
|
@world.controller.button_up(id) |
|
|
|
# @world.controller.button_up(id) |
|
|
|
end |
|
|
|
# end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def button_down(id) |
|
|
|
def button_down(id) |
|
|
@ -92,29 +92,32 @@ class Window < Gosu::Window |
|
|
|
print "down: " |
|
|
|
print "down: " |
|
|
|
p id |
|
|
|
p id |
|
|
|
|
|
|
|
|
|
|
|
if( id == BIND_PAUSE ) then |
|
|
|
# if( id == BIND_PAUSE ) then |
|
|
|
@freeze = !@freeze |
|
|
|
# @freeze = !@freeze |
|
|
|
end |
|
|
|
# end |
|
|
|
|
|
|
|
# |
|
|
|
if( @world && @world.controller ) then |
|
|
|
# if( @world && @world.controller ) then |
|
|
|
@world.controller.button_down(id) |
|
|
|
# @world.controller.button_down(id) |
|
|
|
end |
|
|
|
# end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def button_up?(id) |
|
|
|
def button_up?(id) |
|
|
|
super id |
|
|
|
super id |
|
|
|
|
|
|
|
|
|
|
|
if( @world && @world.controller ) then |
|
|
|
# if( @world && @world.controller ) then |
|
|
|
@world.controller.button_up?(id) |
|
|
|
# @world.controller.button_up?(id) |
|
|
|
end |
|
|
|
# end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def button_down?(id) |
|
|
|
def button_down?(id) |
|
|
|
super id |
|
|
|
super id |
|
|
|
|
|
|
|
|
|
|
|
if( @world && @world.controller ) then |
|
|
|
# if( @world && @world.controller ) then |
|
|
|
@world.controller.button_down?(id) |
|
|
|
# @world.controller.button_down?(id) |
|
|
|
|
|
|
|
# end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private def broadcast_event(event) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def update |
|
|
|
def update |
|
|
|