use key_idle setting directly each time; use xrange