[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Disabling all keybindings - How?
From: |
Stefan Monnier <address@hidden> |
Subject: |
Re: Disabling all keybindings - How? |
Date: |
12 Oct 2002 14:45:29 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
>>>>> "Klaus" == Klaus Berndl <Klaus.Berndl@sdm.de> writes:
> I want to write a very small major-mode with only very few senseful
> keybindings (e.g.: v, h, c, q, s). I want to disable all other keybindings of
> Emacs because they make really no sense (A new frame is started with a new
> buffer in this major-mode, some actions have to be performed by the user
> (e.g.: hitting v or h), stuff is saved by hitting s and then we quit by
> hitting q (which deletes the new frame) - That's all.
You can try
(defvar bla-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "v" 'bla-v-command)
...
(define-key map "s" 'bla-s-command)
;; `t' is a special "default" binding.
(define-key map [t] 'undefined)
map))
it will prevent function-key-map from doing its job, tho since
all keys will be considered bound to `undefined'.
You might also have some problems with the fact that frame
switches (with the mouse) go through a `switch-frame' event,
so you might want to explicitly bind it to nil to make sure
that its binding in the global map is used.
Stefan