add code in ldict.py, it can handle up arrow and down arrow event