stop using keyboard.isDown

[?]
Sep 4, 2023, 7:22 AM
KE4T63TS3DEBC6YKTQNROAPIC7YFBAE264YRTEZLZI5I7KFBZV6AC

Dependencies

  • [2] ED4Z6ORC cleaner API for file-system access
  • [3] ORRSP7FV deduce test names on failures
  • [4] 7IDHIAYI rename modifier_down to key_down
  • [5] JF5L2BBS test harness now supports copy/paste
  • [6] FPY4LO2W make a few names consistent with snake_case
  • [7] UVSNG336 reclaim a couple more functions after tests
  • [8] AVTNUQYR basic test-enabled framework
  • [9] JFFUF5AL override mouse state lookups in tests
  • [10] PX7DDEMO autosave slightly less aggressively
  • [11] AD34IX2Z couple more tests
  • [12] HKV72RZV bugfix: save modified files in save directory
  • [13] ZLJGZYQG select text with shift + mouseclick
  • [*] 3QNOKBFM beginnings of a test harness

Change contents

  • edit in app.lua at line 350
    [2.16026]
    [2.16026]
    local Keys_down = {}
  • replacement in app.lua at line 359
    [3.7787][3.7787:7825]()
    love.handlers[name] = App[name]
    [3.7787]
    [3.7825]
    -- love.keyboard.isDown doesn't work on Android, so emulate it using
    -- keypressed and keyreleased events
    if name == 'keypressed' then
    love.handlers[name] = function(key, scancode, isrepeat)
    Keys_down[key] = true
    return App.keypressed(key, scancode, isrepeat)
    end
    elseif name == 'keyreleased' then
    love.handlers[name] = function(key, scancode)
    Keys_down[key] = nil
    return App.keyreleased(key, scancode)
    end
    else
    love.handlers[name] = App[name]
    end
  • replacement in app.lua at line 429
    [3.1018][3.369:407](),[3.3061][3.369:407]()
    App.key_down = love.keyboard.isDown
    [3.1018]
    [3.5534]
    App.key_down = function(key) return Keys_down[key] end