From 4749e1a01e989999eef9f4131cf2edf6e3211ebc Mon Sep 17 00:00:00 2001 From: sanine-a Date: Fri, 23 Oct 2020 21:52:10 -0500 Subject: add key binding input functions --- demo/main.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'demo') diff --git a/demo/main.lua b/demo/main.lua index ba548b9..ae0684e 100644 --- a/demo/main.lua +++ b/demo/main.lua @@ -4,10 +4,14 @@ end local total_time = 0 +local a_func = function(action, data) + print('a: ', action) +end + +honey.input.bind_key(honey.input.key.a, a_func) + function honey.update(dt) - if honey.input.is_down(honey.input.key.a) then - print('a pressed!') - end + end --function honey.draw() -- cgit v1.2.1