stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[STUMP] Customize Stumpwm to get Emacs style key binding


From: Plato Wu
Subject: [STUMP] Customize Stumpwm to get Emacs style key binding
Date: Fri, 19 Mar 2010 17:22:35 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux)

Sorry for previous disordered post.

I love Emacs and be used to its special key binding style, and
try to customize stumpwm to let other X application could get
the similar key binding.

(defmacro define-key-command (name map kbd (&rest args) (&rest
interactive-args) &body body)
  "merge define-key and defcommand"
  `(progn 
    (defcommand ,name ,args ,interactive-args ,@body)
    (define-key ,map ,kbd ,(string name))))


(defparameter *no-emacs* '("emacs"))

(define-key-command next-line *top-map* (kbd "C-n") () ()
  (if (find (window-title (current-window)) *no-emacs* :test 'string=)
      (send-fake-key (current-window) (kbd "C-n"))
      (progn 
        (xtest:fake-key-event 
         *display* 
         (xlib:keysym->keycodes 
          *display*
          (keysym-name->keysym "Down")) t) 
        (xtest:fake-key-event 
         *display* 
         (xlib:keysym->keycodes 
          *display* 
          (keysym-name->keysym "Down")) nil))))


It is OK if I run command next-line in stumpwm, but when I press C-n,
it works weird, :(

Thank you in advance!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]