Summary: I can change the array value, but when I change the layout the array value returns to what it was before.
In this code here in the photo, if I press Enter on the button option called Right : a variable called Record_keycode becomes True and the sprite font blinks for 5 seconds. At that time in another event, if I press any key on the keyboard it writes that keycode of the pressed key to a specific location in the array called Button_map at (2,54). The problem is that when I leave the menu layout and go to another layout, the array value returns to what it was before, it is not being recorded. I'm not talking about exiting the game (which I'm going to save to local storage), I'm talking about changing layouts. Then I created a test variable called Right_test and also recorded this value in it. The value was saved in the variable. I started messing with array and dictionay a little while ago and found this problem...