pass scan code into scan state transition function
clarify comment
remove commented out code
add functions to determine the state of ALT and GUI modifier keys
rename variables for consistency