I am still very new to coding and got a lot of help from AI so I don't really know what I am doing. My program is suppose to allow me to select an area off my screen and detect for arrow patterns then press the arrow keys in the same pattern sequence as the arrow sequence in the recorded screen area. It records the screen fine but it seems to be pressing the arrow keys in the wrong order and then when no patterns appear on the screen it still seems to be pressing some arrow keys for unknown reasons. I have added the images of the arrow keys in a random sequence for reference and the arrow key images I use for the programs references. I would love some advice on this.
Code link : https://paste.pythondiscord.com/XN3A