[feat, UX] SDL2: drop file to open (#3793)

Includes:

* crengine: use cache files renamed as .cr3.keep https://github.com/koreader/crengine/pull/137
This commit is contained in:
Frans de Jonge
2018-03-22 19:13:54 +01:00
committed by GitHub
parent 2a3f9d6ae2
commit 7e6de30889
2 changed files with 10 additions and 3 deletions

2
base

Submodule base updated: f92a6b5d80...520fcf62b0

View File

@@ -43,12 +43,19 @@ function Device:init()
device = self,
event_map = require("device/sdl/event_map_sdl2"),
handleMiscEv = function(device_input, ev)
-- bit of a hack for passing SDL window resize events
-- bit of a hack for passing SDL events
local SDL_DROPFILE = 4096
local SDL_WINDOWEVENT_RESIZED = 5
local w = 0
local h = 1
if ev.code == w then
if ev.code == SDL_DROPFILE then
local dropped_file_path = input.getDroppedFilePath()
if dropped_file_path and dropped_file_path ~= "" then
local ReaderUI = require("apps/reader/readerui")
ReaderUI:doShowReader(dropped_file_path)
end
elseif ev.code == w then
device_input.new_w = ev.value
elseif ev.code == h then
device_input.new_h = ev.value