template-carousel-mobile/0131-keychord_press_on_file...

13 lines
482 B
Plaintext

keychord_press_on_file_dialog = function(chord, key)
if chord == 'escape' then
reset_file_dialog_state()
elseif chord == 'return' then
File_dialog_callback(File_dialog_input_text)
reset_file_dialog_state()
elseif chord == 'backspace' then
local len = utf8.len(File_dialog_input_text)
local byte_offset = Text.offset(File_dialog_input_text, len)
File_dialog_input_text = string.sub(File_dialog_input_text, 1, byte_offset-1)
refresh_file_dialog_input_start()
end
end