Keyboard: add Chinese stroke-based layout (#9572)

Basically it uses 5 keys for 5 basic stroke types and
inputs characters by their stroke order.
See https://en.wikipedia.org/wiki/Stroke_count_method
This commit is contained in:
weijiuqiao
2022-10-02 07:58:36 +08:00
committed by GitHub
parent 8fcc712c76
commit 05aba404b7
5 changed files with 567 additions and 1 deletions

View File

@@ -139,7 +139,9 @@ if Device:isTouchDevice() or Device:hasDPad() then
self.is_keyboard_hidden = false
end
end
if #self.charlist > 0 then -- Avoid cursor moving within a hint.
-- zh keyboard with candidates shown here has _frame_textwidget.dimen = nil.
-- Check to avoid crash.
if #self.charlist > 0 and self._frame_textwidget.dimen then -- Avoid cursor moving within a hint.
local textwidget_offset = self.margin + self.bordersize + self.padding
local x = ges.pos.x - self._frame_textwidget.dimen.x - textwidget_offset
local y = ges.pos.y - self._frame_textwidget.dimen.y - textwidget_offset