There is a problem (the "if" part).
It doesn't wait for me to click left arrow (as an example) to do the task and just instantly runs it.
from selenium import webdriver
import chromedriver_binary # Adds chromedriver binary to path
from selenium.webdriver import ActionChains
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("https://www.google.com/")
if Keys.ARROW_LEFT:
element = driver.find_element_by_css_selector('.gLFyf')
element.send_keys('khkh')
element.send_keys(Keys.ENTER)