Fixed arrow keys/scrolling.
This commit is contained in:
parent
bcd871a0f3
commit
332fa176f4
5
ldt.lua
5
ldt.lua
@ -405,6 +405,7 @@ ldb = {
|
||||
C.doupdate()
|
||||
stdscr:getch()
|
||||
end
|
||||
stdscr:keypad()
|
||||
stdscr:wbkgd(color())
|
||||
stdscr:clear()
|
||||
stdscr:refresh()
|
||||
@ -627,11 +628,11 @@ ldb = {
|
||||
C.doupdate()
|
||||
local c = stdscr:getch()
|
||||
local _exp_0 = c
|
||||
if C.KEY_DOWN == _exp_0 or C.KEY_SF == _exp_0 or ("j"):byte() == _exp_0 then
|
||||
if C.KEY_DOWN == _exp_0 or C.KEY_SR == _exp_0 or ("j"):byte() == _exp_0 then
|
||||
selected_pad:scroll(1, 0)
|
||||
elseif ('J'):byte() == _exp_0 then
|
||||
selected_pad:scroll(10, 0)
|
||||
elseif C.KEY_UP == _exp_0 or C.KEY_SR == _exp_0 or ("k"):byte() == _exp_0 then
|
||||
elseif C.KEY_UP == _exp_0 or C.KEY_SF == _exp_0 or ("k"):byte() == _exp_0 then
|
||||
selected_pad:scroll(-1, 0)
|
||||
elseif ('K'):byte() == _exp_0 then
|
||||
selected_pad:scroll(-10, 0)
|
||||
|
5
ldt.moon
5
ldt.moon
@ -268,6 +268,7 @@ ldb = {
|
||||
C.doupdate!
|
||||
stdscr\getch!
|
||||
|
||||
stdscr\keypad!
|
||||
stdscr\wbkgd(color!)
|
||||
stdscr\clear!
|
||||
stdscr\refresh!
|
||||
@ -442,12 +443,12 @@ ldb = {
|
||||
C.doupdate!
|
||||
c = stdscr\getch!
|
||||
switch c
|
||||
when C.KEY_DOWN, C.KEY_SF, ("j")\byte!
|
||||
when C.KEY_DOWN, C.KEY_SR, ("j")\byte!
|
||||
selected_pad\scroll(1,0)
|
||||
when ('J')\byte!
|
||||
selected_pad\scroll(10,0)
|
||||
|
||||
when C.KEY_UP, C.KEY_SR, ("k")\byte!
|
||||
when C.KEY_UP, C.KEY_SF, ("k")\byte!
|
||||
selected_pad\scroll(-1,0)
|
||||
when ('K')\byte!
|
||||
selected_pad\scroll(-10,0)
|
||||
|
Loading…
Reference in New Issue
Block a user