If you want to control keyboard rate over emacs session you may want to do this:

  ;; Installs C-ck Prefix for Keyboard control commands
  (defun my-set-keyrate (lat rate)
    (shell-command (format "xset r rate %d %d" lat rate)))

  (define-key global-map "\C-ckd"
    (lambda ()
      (my-set-keyrate 250 50)
      (message "Default keyrate intalled."))) ;default keyrate
  (define-key global-map "\C-ckf"
    (lambda ()
      (my-set-keyrate 250 100)
      (message "Fast keyrate intalled"))) ;fast
  (define-key global-map "\C-cks"
    (lambda ()
      (my-set-keyrate 250 25)
      (message "Slow keyrate installed"))) ;slow

I like to use fast rate at the morning, slow - after dinner and default for the rest time. --ZajcevEvgeny