Skip to content

Instantly share code, notes, and snippets.

@Petethegoat
Created May 21, 2019 21:59
Show Gist options
  • Save Petethegoat/065d51452bda4adf6c902cc9c32f6625 to your computer and use it in GitHub Desktop.
Save Petethegoat/065d51452bda4adf6c902cc9c32f6625 to your computer and use it in GitHub Desktop.
local function onKeyDown(e)
if e.keyCode == tes3.worldController.inputController.inputMaps[20].code then
journalKey = e.keyCode
tes3.worldController.inputController.inputMaps[20].code = nil
if tes3ui.findMenu(menuBook) then
tes3ui.findMenu(menuBook):findChild(menuBook_button_close):triggerEvent("mouseClick")
tes3ui.leaveMenuMode()
else
showJournalUI()
end
end
end
event.register("keyDown", onKeyDown)
local function onKeyUp(e)
if e.keyCode == journalKey then
tes3.worldController.inputController.inputMaps[20].code = journalKey
end
end
event.register("keyUp", onKeyUp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment