Engine 0.0.6
Game engine in lua
Loading...
Searching...
No Matches
keys.lua
Go to the documentation of this file.
1local key_bindings = {
2 ['return']='enter',
3 up='up',
4 left='left',
5 right='right',
6 down='down',
7 z='red',
8 x='green',
9 c='yellow',
10 v='blue',
11}
12
13local function keydown(std, game, application, real_key)
14 local key = key_bindings[real_key]
15 if key then
16 std.key.press[key] = 1
17 end
18end
19
20local function keyup(std, game, application, real_key)
21 local key = key_bindings[real_key]
22 if key then
23 std.key.press[key] = 0
24 end
25end
26
27local function install(std, game, application)
28 return {
29 event={
30 keydown=keydown,
31 keyup=keyup
32 }
33 }
34end
35
36local P = {
38}
39
40return P
local application
Definition main.lua:16
local game
Definition main.lua:17
local std
Definition main.lua:18
local function install(std, lgame, application, ginga)