Register key bindings in the env with RunControl

This commit is contained in:
Thibault Jouan
2015-04-14 21:26:29 +00:00
parent b1aa430ef3
commit 2a1a1f1185
5 changed files with 31 additions and 4 deletions

View File

@@ -44,6 +44,9 @@ module Uh
def connect_manager
@manager.connect
@manager.grab_key :q
@env.keybinds.each do |keysym, _|
@manager.grab_key *keysym
end
end
def run_until &block
@@ -70,6 +73,9 @@ module Uh
def register_key_bindings_hooks
@events.on(:key, :q) { stop! }
@env.keybinds.each do |keysym, code|
@events.on :key, keysym, &code
end
end
end
end