;;; $Id: minh-xkeys.el,v 1.1 2007/08/24 09:36:07 minh Exp $ ;;; Copyright (c) 2006, 2007 Nhat Minh LĂȘ. All rights reserved. ;;; ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions ;;; are met: ;;; ;;; 1. Redistributions of source code must retain the above copyright ;;; notice, this list of conditions and the following disclaimer. ;;; ;;; 2. Redistributions in binary form must reproduce the above ;;; copyright notice, this list of conditions and the following ;;; disclaimer in the documentation and/or other materials provided ;;; with the distribution. ;;; ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;;; This file is part of Minh's Emacs setup. (defun minh-setup-x-control-keys () "Set up control keys to work as they do in the console. C-3 ESC C-4 C-\\ C-5 C-] C-6 C-^ C-7 C-_ C-8 DEL" (define-key key-translation-map [?\C-3] [?\C-\[]) (define-key key-translation-map [?\M-\C-3] [?\M-\C-\[]) (define-key key-translation-map [?\C-4] [?\C-\\]) (define-key key-translation-map [?\M-\C-4] [?\M-\C-\\]) (define-key key-translation-map [?\C-5] [?\C-\]]) (define-key key-translation-map [?\M-\C-5] [?\M-\C-\]]) (define-key key-translation-map [?\C-6] [?\C-^]) (define-key key-translation-map [?\M-\C-6] [?\M-\C-^]) (define-key key-translation-map [?\C-7] [?\C-_]) (define-key key-translation-map [?\M-\C-7] [?\M-\C-_]) (define-key key-translation-map [?\C-8] [?\C-?]) (define-key key-translation-map [?\M-\C-8] [?\M-\C-?]) (define-key key-translation-map [\S-f1] [f11]) (define-key key-translation-map [\S-f2] [f12]) (define-key key-translation-map [\S-f3] [f13]) (define-key key-translation-map [\S-f4] [f14]) (define-key key-translation-map [\S-f5] [f15]) (define-key key-translation-map [\S-f6] [f16]) (define-key key-translation-map [\S-f7] [f17]) (define-key key-translation-map [\S-f8] [f18]) (define-key key-translation-map [\S-f9] [f19]) (define-key key-translation-map [\S-f10] [f20]) (define-key key-translation-map [\S-f11] [f21]) (define-key key-translation-map [\S-f12] [f22])) (defun minh-setup-xterm-keys () "Set up key combinations for xterm." (define-key key-translation-map "\eO1;2P" [f11]) (define-key key-translation-map "\eO1;2Q" [f12]) (define-key key-translation-map "\eO1;2R" [f13]) (define-key key-translation-map "\eO1;2S" [f14])) (provide 'minh-xkeys)