code question

That line makes the setKey function just store in the dict object that the “backward” key is pressed. It doesn’t do anything yet, somewhere else in the code you see that it actually checks the dict whether the key was pressed and updates teh position based on that.
So, in order to make this work, you need to add some code that actually does something with that “backward” value.