Lua
natiny.input.get_char_at(index) -> codepoint
Returns the Unicode code point from the current frame text-input buffer at the specified index.
Parameters
| Name |
Type |
Description |
index |
number |
Zero-based character index |
Returns
| Type |
Description |
number |
Unicode code point, or 0 for an invalid index |
Example
Lua
local cp = natiny.input.get_char_at(0)
if cp ~= 0 then
print("first code point:", cp)
end
Notes
- The index is zero-based. Negative and out-of-range indexes return
0.
- Values are Unicode code points produced by text input, not physical key codes.