rewrite toggle kbd macro recording

Signed-off-by: coldnew <coldnew.tw@gmail.com>