Skip to content
Snippets Groups Projects

Add TextInput hook

Open Hanicef requested to merge Hanicef/SRB2Classic:add-textinput-hook into next

With !1952 (merged) being queued up for 2.2.14, it would only be logical to expose that API to Lua, so scripters can take advantage of this, too. This also complements KeyDown and KeyUp hooks, but due to technical reasons around dead keys and such, TextInput won't be invoked unless input.setTextInputMode is called first (this is also true for the engine; there is no exception for Lua here).

Example script:

addHook("MapLoad", function (mapnumber)
  input.setTextInputMode(true)
end)
addHook("TextInput", function (textevent)
  print(textevent.text)
end)
Edited by Hanicef

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading