mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[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:
2
base
2
base
Submodule base updated: f92a6b5d80...520fcf62b0
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user