Implement generic internal clipboard for all devices

Will allow copying selected text from a book to the TextEditor.
Will be overriden on devices that implement interactions with
the system clipboard.
pull/4487/head
poire-z 5 years ago
parent 4d67dd59ca
commit a245630422

@ -24,7 +24,7 @@ local Device = {
isTouchDevice = no,
hasFrontlight = no,
needsTouchScreenProbe = no,
hasClipboard = no,
hasClipboard = yes, -- generic internal clipboard on all devices
hasColorScreen = no,
hasBGRFrameBuffer = no,
canToggleGSensor = no,

@ -75,6 +75,8 @@ local MSC_RAW_GSENSOR_FRONT = 0x1c
-- luacheck: pop
local _internal_clipboard_text = nil -- holds the last copied text
local Input = {
-- this depends on keyboard layout and should be overridden:
event_map = {},
@ -141,6 +143,17 @@ local Input = {
}
},
gesture_detector = nil,
-- simple internal clipboard implementation, can be overidden to use system clipboard
hasClipboardText = function()
return _internal_clipboard_text ~= nil and _internal_clipboard_text ~= ""
end,
getClipboardText = function()
return _internal_clipboard_text
end,
setClipboardText = function(text)
_internal_clipboard_text = text
end,
}
function Input:new(o)

Loading…
Cancel
Save