While I can easily get the system scancodes by just requesting the corresponding setting like so …
Code: Select all
local dig_scancode = core.settings:get('keymap_dig')
local fast_scancode = core.settings:get('keymap_fastmove')
local fly_scancode = core.settings:get('keymap_freemove')
-- Do something, link print-dumping them
print(dump(dig_scancode)) -- result: "KEY_LBUTTON"
print(dump(fast_scancode)) -- result: "SYSTEM_SCANCODE_224"
print(dump(fly_scancode)) -- result: "SYSTEM_SCANCODE_14"But Luanti already has a function for getting the key name (even localized) fromt he scancode, it does so in the key configuration.
here, in German
So, the information is already known to the client, I just need a way to display that information somewhere (GUI, formspec, tooltip, chat, etc.)
I wonder if I somehow can use this function in a mod, or if there are other methods achieving the same result (localized key name from scancode like in the settings).
Any Idea or help would be appreciated!