@@ -4,7 +4,6 @@ local gc_stc_reset,gc_stc_rect,gc_stc_stop=GC.stc_reset,GC.stc_rect,GC.stc_stop
4
4
local gc_translate ,gc_replaceTransform = GC .translate ,GC .replaceTransform
5
5
6
6
local ins = table.insert
7
- local kbIsDown = love .keyboard .isDown
8
7
--- @type Zenitha.Scene
9
8
local scene = {}
10
9
@@ -349,7 +348,7 @@ function scene.keyDown(key,isRep)
349
348
if WIDGET .isFocus (inputBox ) and # key == 1 then return true end
350
349
local act = KEYMAP .sys :getAction (key )
351
350
if act == ' up' or act == ' down' then
352
- if not (IsCtrlDown () or IsShiftDown () or isAltDown ()) then
351
+ if not (IsCtrlDown () or IsShiftDown () or IsAltDown ()) then
353
352
local sel = listBox :getItem ()
354
353
listBox :arrowKey (key )
355
354
if listBox :getItem ()~= sel then
@@ -396,7 +395,7 @@ local function scroll(dy)
396
395
contents .scroll = MATH .clamp (contents .scroll - dy ,0 ,contents .maxScroll )
397
396
end
398
397
function scene .mouseMove (x ,y ,_ ,dy )
399
- if not WIDGET .isFocus (listBox ) and love . mouse . isDown (1 ) and x and y and inScreen (x ,y ) then
398
+ if not WIDGET .isFocus (listBox ) and IsMouseDown (1 ) and x and y and inScreen (x ,y ) then
400
399
scroll (dy )
401
400
end
402
401
end
@@ -442,8 +441,8 @@ function scene.update(dt)
442
441
end
443
442
searchTimer = 0
444
443
end
445
- if kbIsDown (' up' ,' down' ) and (IsCtrlDown () or IsShiftDown () or isAltDown ()) then
446
- scroll (260 * dt * (kbIsDown (' up' ) and 1 or - 1 ))
444
+ if IsKeyDown (' up' ,' down' ) and (IsCtrlDown () or IsShiftDown () or IsAltDown ()) then
445
+ scroll (260 * dt * (IsKeyDown (' up' ) and 1 or - 1 ))
447
446
end
448
447
end
449
448
@@ -501,7 +500,7 @@ function scene.draw()
501
500
local fontH = FONT .get (selected .contentSize ):getHeight ()
502
501
gc_translate (0 ,- mainH / 2 + 5 )
503
502
for _ ,line in next ,contents .texts do
504
- if love . keyboard . isDown (' f1' ) then
503
+ if IsKeyDown (' f1' ) then
505
504
gc_setLineWidth (1 )
506
505
gc_rectangle (' line' ,15 ,0 ,mainW - 25 ,line .height )
507
506
end
0 commit comments