mirror of
https://github.com/20kdc/OC-KittenOS.git
synced 2024-11-27 04:48:05 +11:00
Bugfix: fix 'delete' key, fix Everest KB/M matching
This commit is contained in:
parent
7840f0a231
commit
22c1c211ef
@ -273,6 +273,10 @@ local function key(ks, kc, down)
|
|||||||
cursorY = cursorY - 1
|
cursorY = cursorY - 1
|
||||||
cursorX = unicode.len(lines[cursorY]) + 1
|
cursorX = unicode.len(lines[cursorY]) + 1
|
||||||
lines[cursorY] = lines[cursorY] .. l
|
lines[cursorY] = lines[cursorY] .. l
|
||||||
|
elseif lX == "w>" and cursorY ~= #lines then
|
||||||
|
local l = table.remove(lines, cursorY)
|
||||||
|
cursorX = unicode.len(l) + 1
|
||||||
|
lines[cursorY] = l .. lines[cursorY]
|
||||||
elseif lX == "nl" then
|
elseif lX == "nl" then
|
||||||
local line = lines[cursorY]
|
local line = lines[cursorY]
|
||||||
lines[cursorY] = unicode.sub(line, 1, cursorX - 1)
|
lines[cursorY] = unicode.sub(line, 1, cursorX - 1)
|
||||||
|
@ -600,13 +600,16 @@ end
|
|||||||
local isAltDown = false
|
local isAltDown = false
|
||||||
local isCtrDown = false
|
local isCtrDown = false
|
||||||
local function key(ku, ka, kc, down)
|
local function key(ku, ka, kc, down)
|
||||||
local ku = screens.getMonitorByKeyboard(ku)
|
local ku, lin = screens.getMonitorByKeyboard(ku)
|
||||||
if not ku then return end
|
|
||||||
for k, v in ipairs(monitors) do
|
for k, v in ipairs(monitors) do
|
||||||
if v[2] == mu then
|
if ku and v[2] == ku then
|
||||||
lIM = k
|
lin = k
|
||||||
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if not lin then return end
|
||||||
|
lIM = lin
|
||||||
|
|
||||||
local focus = surfaces[1]
|
local focus = surfaces[1]
|
||||||
if kc == 29 then isCtrDown = down end
|
if kc == 29 then isCtrDown = down end
|
||||||
if kc == 56 then isAltDown = down end
|
if kc == 56 then isAltDown = down end
|
||||||
|
@ -31,6 +31,7 @@ return {
|
|||||||
key = function (ks, kc, line, cursorX)
|
key = function (ks, kc, line, cursorX)
|
||||||
local cS = unicode.sub(line, 1, cursorX - 1)
|
local cS = unicode.sub(line, 1, cursorX - 1)
|
||||||
local cE = unicode.sub(line, cursorX)
|
local cE = unicode.sub(line, cursorX)
|
||||||
|
local ll = unicode.len(line)
|
||||||
if kc == 203 then -- navi <
|
if kc == 203 then -- navi <
|
||||||
if cursorX > 1 then
|
if cursorX > 1 then
|
||||||
return nil, cursorX - 1
|
return nil, cursorX - 1
|
||||||
@ -39,7 +40,6 @@ return {
|
|||||||
return nil, nil, "l<"
|
return nil, nil, "l<"
|
||||||
end
|
end
|
||||||
elseif kc == 205 then -- navi >
|
elseif kc == 205 then -- navi >
|
||||||
local ll = unicode.len(line)
|
|
||||||
if cursorX > ll then
|
if cursorX > ll then
|
||||||
-- cline overflow
|
-- cline overflow
|
||||||
return nil, nil, "l>"
|
return nil, nil, "l>"
|
||||||
@ -49,14 +49,18 @@ return {
|
|||||||
return nil, 1
|
return nil, 1
|
||||||
elseif kc == 207 then -- end
|
elseif kc == 207 then -- end
|
||||||
return nil, unicode.len(line) + 1
|
return nil, unicode.len(line) + 1
|
||||||
elseif ks == "\8" or kc == 211 then -- del
|
elseif ks == "\8" then -- del
|
||||||
if cursorX == 1 then
|
if cursorX == 1 then
|
||||||
-- weld prev
|
-- weld prev
|
||||||
return nil, nil, "w<"
|
return nil, nil, "w<"
|
||||||
else
|
else
|
||||||
cS = unicode.sub(cS, 1, unicode.len(cS) - 1)
|
return unicode.sub(cS, 1, unicode.len(cS) - 1) .. cE, cursorX - 1
|
||||||
return cS .. cE, cursorX - 1
|
|
||||||
end
|
end
|
||||||
|
elseif kc == 211 then -- del
|
||||||
|
if cursorX > ll then
|
||||||
|
return nil, nil, "w>"
|
||||||
|
end
|
||||||
|
return cS .. unicode.sub(cE, 2)
|
||||||
elseif ks then -- standard letters
|
elseif ks then -- standard letters
|
||||||
if ks == "\r" then
|
if ks == "\r" then
|
||||||
-- new line
|
-- new line
|
||||||
|
@ -65,6 +65,10 @@ The following extended actions exist:
|
|||||||
the previous line, and the cursor
|
the previous line, and the cursor
|
||||||
should be placed at the weld point.
|
should be placed at the weld point.
|
||||||
|
|
||||||
|
"w>": This line should be welded to
|
||||||
|
the next line, and the cursor
|
||||||
|
should be placed at the weld point.
|
||||||
|
|
||||||
"nl": The Enter button was pressed.
|
"nl": The Enter button was pressed.
|
||||||
|
|
||||||
-- This is released into
|
-- This is released into
|
||||||
|
Loading…
Reference in New Issue
Block a user