1) where are you trying to do this at? in a standalone script or in a game script inside the Editor?
2) both have the keycode information, but engine_const has more info for buffers, entities, etc...
try this code outside of the editor, by opening up the ScriptEditor located in the SDK directory and press play. works just fine for me...
require("scripts/constants/engine_const")
--Register abstract path
RegisterAbstractPath("")
--Set graphics mode
if Graphics(1024,768)==0 then
Notify("Failed to set graphics mode.",1)
return
end
--Create framewerk object and set it to a global object so other scripts can access it
fw=CreateFramework()
if fw==nil then
Notify("Failed to initialize engine.",1)
return
end
fw.main.camera:SetPositionf(0,0,-2)
light=CreateSpotLight(10)
light:SetRotationf(45,55,0)
light:SetPositionf(5,5,-5)
material=LoadMaterial("abstract::cobblestones.mat")
mesh=CreateCube()
mesh:Paint(material)
ground=CreateCube()
ground:SetScalef(10.0,1.0,10.0)
ground:SetPositionf(0.0,-2.0,0.0)
ground:Paint(material)
light=CreateDirectionalLight()
light:SetRotationf(45,45,45)
while AppTerminate()==0 do
mesh:Turnf(AppSpeed()*0.5,AppSpeed()*0.5,AppSpeed()*0.5)
if KeyDown (KEY_D)==1 then TurnEntity (fw.main.camera, Vec3(0,-.1,0)) end
if KeyDown (KEY_A)==1 then TurnEntity (fw.main.camera, Vec3(0,.1,0)) end
if KeyDown (KEY_W)==1 then MoveEntity (fw.main.camera, Vec3(0,0,.1)) end
if KeyDown (KEY_S)==1 then MoveEntity (fw.main.camera, Vec3(0,0,-.1)) end
if KeyDown (KEY_Q)==1 then MoveEntity (fw.main.camera, Vec3(0,.1,0)) end
if KeyDown (KEY_Z)==1 then MoveEntity (fw.main.camera, Vec3(0,-.1,0)) end
fw:Update()
fw:Render()
Flip(0)
end