add key handler

issue #7481