summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTom Black <[email protected]>2016-10-09 16:49:27 -0400
committerTom Black <[email protected]>2016-10-09 16:49:27 -0400
commit6d96afd6421c68eaf42b319a282d69a8bbd40031 (patch)
tree3c73986cea840cf3982549c1916f11692ae99a53
parentfa8ceec20f04fcdfe14189aa415ad1b5f8c32728 (diff)
downloadruby2d-6d96afd6421c68eaf42b319a282d69a8bbd40031.tar.gz
ruby2d-6d96afd6421c68eaf42b319a282d69a8bbd40031.zip
Add "any" key option
Where's the 'any' key? Whew! All this computer hacking is making me thirsty.
-rw-r--r--lib/ruby2d/window.rb6
1 files changed, 6 insertions, 0 deletions
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