You should input maps, not directly working with keycodes (it might work either way, but it will make you life harder). You can definite input maps in the project settings, second tab. It would look something like this (you have to define the "quit_game" string in the input mapping).
func _input(event):
if event.is_action_pressed("quit_game"):
get_tree().quit()
Also notice we work with the event, not the Input class directly.