quickfix for direction keys

Quick fix for help menu (fix #5881). BTW, this issue cause a fault on windows.

I have some ideas about changing this function, will do it later (in separate PR).