
(setq key-qw-pressed 0)

(defun key-qw ()
  (interactive)
  (setq key-qw-pressed (1+ key-qw-pressed))
  (setq key-qw-pressed (mod key-qw-pressed 3))
  ;;(message "key-qw-pressed=%s" (mod key-qw-pressed 2))
  (if (/= key-qw-pressed 0)
      (progn
        ;;(backward-delete-char 1)
        (insert "w")
        )
    (progn
      (backward-delete-char 1)
      (insert "q")
      )))

(global-set-key "q" 'key-qw)
(global-set-key "w" 'key-qw)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(setq key-as-pressed 0)

(defun key-as ()
  (interactive)
  (setq key-as-pressed (1+ key-as-pressed))
  (setq key-as-pressed (mod key-as-pressed 3))
  ;;(message "key-as-pressed=%s" (mod key-as-pressed 2))
  (if (/= key-as-pressed 0)
      (progn
        ;;(backward-delete-char 1)
        (insert "a")
        )
    (progn
      (backward-delete-char 1)
      (insert "s")
      )))
      
(global-set-key "a" 'key-as)
(global-set-key "s" 'key-as)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(setq key-zx-pressed 0)

(defun key-zx ()
  (interactive)
  (setq key-zx-pressed (1+ key-zx-pressed))
  (setq key-zx-pressed (mod key-zx-pressed 3))
  ;;(message "key-zx-pressed=%s" (mod key-zx-pressed 2))
  (if (/= key-zx-pressed 0)
      (progn
        ;;(backward-delete-char 1)
        (insert "z")
        )
    (progn
      (backward-delete-char 1)
      (insert "x")
      )))
      
(global-set-key "z" 'key-zx)
(global-set-key "x" 'key-zx)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(global-set-key "\C-z" 'd-empty-function)

(defun d-empty-function ()
  (interactive)
  )

(provide 'broken-keyboard)

