I don’t know why but typing input works, but backspace and enter doesn’t do anything. The label doesn’t get deleted.
function on_input(self, action_id, action)
if action_id == hash("type") then
msg.post("/computer_sound#computer-sound", "play_keyboard")
self.message = self.message .. action.text
label.set_text("#code_input_box", self.message)
elseif action_id == hash("backspace") and action.repeated then
msg.post("/computer_sound#computer-sound", "play_keyboard")
local l = string.len(self.message)
self.message = string.sub(self.message, 0, l-1)
label.set_text("#code_input_box", self.message)
elseif action_id==hash("enter") then
msg.post("/computer_sound#computer-sound", "play_keyboard")
if self.message == actual_book_code then
msg.post("/minigame_go#insert-book_code", "delete_book")
end
end
end