implement rc_keys function, fixes #2