replaces oldjs with scm_old_input_state to be more generic.