2
0
mirror of https://github.com/koreader/koreader synced 2024-11-13 19:11:25 +00:00
koreader/frontend/device/emulator/device.lua
2014-11-03 10:08:55 +01:00

28 lines
644 B
Lua

local Generic = require("device/generic/device")
local util = require("ffi/util")
local function yes() return true end
local Device = Generic:new{
model = "Emulator",
isEmulator = yes,
hasKeyboard = yes,
hasKeys = yes,
hasFrontlight = yes,
isTouchDevice = yes,
}
function Device:init()
self.screen = require("device/screen"):new{device = self}
self.input = require("device/input"):new{
device = self,
event_map = util.haveSDL2()
and require("device/emulator/event_map_sdl2")
or require("device/emulator/event_map_sdl"),
}
Generic.init(self)
end
return Device