diff --git a/frontend/device/generic/device.lua b/frontend/device/generic/device.lua index c592b39e8..e6d536b5b 100644 --- a/frontend/device/generic/device.lua +++ b/frontend/device/generic/device.lua @@ -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, diff --git a/frontend/device/input.lua b/frontend/device/input.lua index b87a7a6a0..5d130ec00 100755 --- a/frontend/device/input.lua +++ b/frontend/device/input.lua @@ -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)