Engine
0.0.6
Game engine in lua
Loading...
Searching...
No Matches
keys.lua
Go to the documentation of this file.
1
local 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
13
local 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
18
end
19
20
local 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
25
end
26
27
local function
install
(
std
,
game
,
application
)
28
return
{
29
event
={
30
keydown=keydown,
31
keyup=keyup
32
}
33
}
34
end
35
36
local P = {
37
install
=
install
38
}
39
40
return
P
application
local application
Definition
main.lua:16
game
local game
Definition
main.lua:17
std
local std
Definition
main.lua:18
install
local function install(std, lgame, application, ginga)
src
engine
core
love
keys.lua
Generated by
1.12.0