From 6d96afd6421c68eaf42b319a282d69a8bbd40031 Mon Sep 17 00:00:00 2001 From: Tom Black Date: Sun, 9 Oct 2016 16:49:27 -0400 Subject: Add "any" key option Where's the 'any' key? Whew! All this computer hacking is making me thirsty. --- lib/ruby2d/window.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/ruby2d/window.rb b/lib/ruby2d/window.rb index 1d47e7b..73674fb 100644 --- a/lib/ruby2d/window.rb +++ b/lib/ruby2d/window.rb @@ -112,6 +112,9 @@ module Ruby2D def key_callback(key) key.downcase! @on_key_proc.call(key) + if @keys.has_key? 'any' + @keys['any'].call + end if @keys.has_key? key @keys[key].call end @@ -129,6 +132,9 @@ module Ruby2D def key_down_callback(key) key.downcase! + if @keys_down.has_key? 'any' + @keys_down['any'].call + end if @keys_down.has_key? key @keys_down[key].call end -- cgit v1.2.3