tvz wrote:Please help me by improving it
In what way? With the method you are using right now, there isn't really a need for the remapKey function, as you are just using a variable to hold the key values. That would work, if you don't actually use keydown events (and instead just use getKeyState).