From 388ad92bb418ada2f8b46643518e5f8f3e1fcbc5 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Fri, 21 Jan 2022 10:02:20 +0100 Subject: [PATCH] Old key sys --- src/app.rb | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/app.rb b/src/app.rb index 15c47ef..ddbc908 100755 --- a/src/app.rb +++ b/src/app.rb @@ -94,9 +94,11 @@ class Window < Gosu::Window @up_keyhook.call(KEY_EVENTS[id]) @key_events[:down].delete(id) # when the key is released: stop holding it -# if( @world && @world.controller ) then -# @world.controller.button_up(id) -# end +=begin + if( @world && @world.controller ) then + @world.controller.button_up(id) + end +=end end def button_down(id) @@ -106,13 +108,13 @@ class Window < Gosu::Window @key_events[:down] << id -# if( id == BIND_PAUSE ) then -# @freeze = !@freeze -# end -# -# if( @world && @world.controller ) then -# @world.controller.button_down(id) -# end + if( id == BIND_PAUSE ) then + @freeze = !@freeze + end + + if( @world && @world.controller ) then + @world.controller.button_down(id) + end end private def broadcast_event(event)