modify script to fit keyboard operation