Yeah, but there are other lines as well 🙂
Here's an automatic class that listens to action sequences, and when it finds something, it notifies about that via a signal:
class_name CheatCodeListener extends Node
signal code_entered(name)
var s: String
var cheats = {"ui_up ui_down ui_up" : "some cheat", "ui_left ui_right" : "some other cheat"}
func _input(e):
for a in InputMap.get_actions().filter(func(aa): return e.is_action_pressed(aa)).slice(0,1):
s += a if not s else " " + a
for k in cheats.keys(): if s.contains(k): code_entered.emit(cheats[k]); s = ""
Now the only thing left to do is to make a game to cheat at. Easy peasy 😃