local ____lualib = require("lualib_bundle")
local Set = ____lualib.Set
local __TS__New = ____lualib.__TS__New
local __TS__Class = ____lualib.__TS__Class
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
local __TS__Iterator = ____lualib.__TS__Iterator
local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
local ____cachedEnumValues = require("cachedEnumValues")
local KEYBOARD_VALUES = ____cachedEnumValues.KEYBOARD_VALUES
local ____input = require("functions.input")
local isKeyboardPressed = ____input.isKeyboardPressed
local ____CustomCallback = require("classes.private.CustomCallback")
local CustomCallback = ____CustomCallback.CustomCallback
local v = {run = {pressedKeys = __TS__New(Set)}}
____exports.PostKeyboardChanged = __TS__Class()
local PostKeyboardChanged = ____exports.PostKeyboardChanged
PostKeyboardChanged.name = "PostKeyboardChanged"
__TS__ClassExtends(PostKeyboardChanged, CustomCallback)
function PostKeyboardChanged.prototype.____constructor(self)
    CustomCallback.prototype.____constructor(self)
    self.v = v
    self.shouldFire = function(____, fireArgs, optionalArgs)
        local keyboard, pressed = table.unpack(fireArgs)
        local callbackKeyboard, callbackPressed = table.unpack(optionalArgs)
        return (callbackKeyboard == nil or callbackKeyboard == keyboard) and (callbackPressed == nil or callbackPressed == pressed)
    end
    self.postRender = function()
        for ____, keyboard in __TS__Iterator(v.run.pressedKeys) do
            if not isKeyboardPressed(nil, keyboard) then
                v.run.pressedKeys:delete(keyboard)
                self:fire(keyboard, false)
            end
        end
        for ____, keyboard in ipairs(KEYBOARD_VALUES) do
            do
                if v.run.pressedKeys:has(keyboard) then
                    goto __continue8
                end
                if isKeyboardPressed(nil, keyboard) then
                    v.run.pressedKeys:add(keyboard)
                    self:fire(keyboard, true)
                end
            end
            ::__continue8::
        end
    end
    self.callbacksUsed = {{ModCallback.POST_RENDER, self.postRender}}
end
return ____exports
