Problems detecting Android back button in Lua

Any guesses why this shouldn’t work?:

local function onKeyReleased(keyCode, event)
    if keyCode == cc.KeyCodeKey.KEY_ESCAPE and self.backButtonListener then
        self.backButtonListener()
    end
end
local keyListener = cc.EventListenerKeyboard:create()
keyListener:registerScriptTapHandler(onKeyReleased, cc.Handler.EVENT_KEYBOARD_RELEASED)

It doesn’t detect the ESC key when running under the simulator either.

Because I’m an idiot! Please ignore me.