/usr/share/emacs/site-lisp/uim-el/uim-keymap.el is in uim-el 1:1.8.6-4ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | ;;
;; Copyright (c) 2005-2013 uim Project http://code.google.com/p/uim/
;;
;; 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.
;; 3. Neither the name of authors nor the names of its
;; contributors may be used to endorse or promote products
;; derived from this software without specific prior written
;; permission.
;;
;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
;; CONTRIBUTORS "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 COPYRIGHT OWNER OR
;; CONTRIBUTORS 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.
;;
;;
;; Mouse event for GNU Emacs
;;
(defconst uim-mouse-modifiers
'(
()
(down)
(drag)
(double)
(double down)
(double drag)
(triple)
(triple down)
(triple drag)
))
(defconst uim-generic-modifiers
'(
()
(shift)
(control)
(meta)
(shift control)
(shift meta)
(control meta)
(shift control meta)
))
(defun uim-mouse-set-point (event)
(interactive "e")
(mouse-minibuffer-check event)
(let ((posn (event-end event)))
(when (windowp (posn-window posn))
(select-window (posn-window posn))
)))
;;
;; Bind all mouse event to nil (for GNU Emacs)
;;
(defun uim-unbind-mouse-event ()
(mapcar
'(lambda (w)
(mapcar
'(lambda (x)
(mapcar
'(lambda (y)
(let ((event (vector (append w x (list y)))))
(define-key uim-mode-map event nil)
(define-key uim-preedit-map event nil)
))
'(mouse-1 mouse-2 mouse-3 mouse-4 mouse-5)))
uim-mouse-modifiers))
uim-generic-modifiers)
(define-key uim-mode-map [vertical-scroll-bar] nil)
(define-key uim-mode-map [mode-line] nil)
(define-key uim-mode-map [vertical-line] nil)
(define-key uim-mode-map [mouse-movement] nil)
(define-key uim-mode-map [scroll-bar-movement] nil)
(define-key uim-mode-map [switch-frame] nil)
(define-key uim-mode-map [delete-frame] nil)
(define-key uim-mode-map [iconify-frame] nil)
(define-key uim-mode-map [make-frame-visible] nil)
;; for uim-preedit-map
;; menu-bar/tool-bar operation must be avoided
(define-key uim-preedit-map [vertical-scroll-bar] nil)
(define-key uim-preedit-map [mode-line] nil)
(define-key uim-preedit-map [vertical-line] nil)
(define-key uim-preedit-map [mouse-movement] nil)
(define-key uim-preedit-map [scroll-bar-movement] nil)
(define-key uim-preedit-map [switch-frame] nil)
(define-key uim-preedit-map [delete-frame] nil)
(define-key uim-preedit-map [iconify-frame] nil)
(define-key uim-preedit-map [make-frame-visible] nil)
)
;;
;; Initialize keymap
;;
(defun uim-init-keymap ()
(setq uim-mode-map (make-sparse-keymap))
(setq uim-preedit-map (make-sparse-keymap))
(setq uim-dummy-map (make-sparse-keymap))
(define-prefix-command 'uim-escape-map)
;; set default key-binds
(cond (uim-xemacs ;; XEmacs
(set-keymap-default-binding uim-mode-map 'uim-process-input)
(set-keymap-default-binding uim-preedit-map 'uim-process-input)
(define-key uim-mode-map [escape] 'uim-process-input)
(define-key uim-mode-map [(control ?\[)] 'uim-process-input)
)
((and uim-emacs (= emacs-major-version 20)) ;;; GNU Emacs-20.7
(define-key uim-mode-map [t] 'uim-process-input)
(define-key uim-preedit-map [t] 'uim-process-input)
(define-key uim-escape-map [t] 'uim-process-input)
(define-key uim-mode-map [27] 'uim-escape-map)
(define-key uim-preedit-map [27] 'uim-escape-map)
(if (not window-system)
(define-key uim-mode-map [27] 'uim-process-input))
)
((and uim-emacs (= emacs-major-version 21)) ;;; GNU Emacs-21.x
(define-key uim-mode-map [t] 'uim-process-input)
(define-key uim-preedit-map [t] 'uim-process-input)
(define-key uim-mode-map [27] 'uim-process-input)
)
((and uim-emacs (>= emacs-major-version 22)) ;;; GNU Emacs-22 or later
(define-key uim-mode-map [t] 'uim-process-input)
(define-key uim-preedit-map [t] 'uim-process-input)
(define-key uim-mode-map [27] 'uim-process-input)
)
)
(when uim-emacs
(uim-unbind-mouse-event)
)
(when uim-xemacs
(setq uim-toolbar-map (make-sparse-keymap))
(set-keymap-default-binding uim-toolbar-map 'ignore)
)
)
;;
;; Disable other minor-mode keymaps while preedit strings or candidates
;; are displayed.
;;
(defun uim-disable-other-minor-mode-map ()
(when (not uim-minor-mode-map-alist)
(setq uim-minor-mode-map-alist minor-mode-map-alist)
(setq minor-mode-map-alist (list (assq 'uim-mode minor-mode-map-alist)))
(when (and uim-emacs (>= emacs-major-version 22))
(setq uim-emulation-mode-map-alists emulation-mode-map-alists)
(setq emulation-mode-map-alists nil)))
)
(defun uim-enable-other-minor-mode-map ()
(when uim-minor-mode-map-alist
(setq minor-mode-map-alist uim-minor-mode-map-alist)
(setq uim-minor-mode-map-alist nil)
(when (and uim-emacs (>= emacs-major-version 22))
(setq emulation-mode-map-alists uim-emulation-mode-map-alists)
(setq uim-emulation-mode-map-alists nil)))
)
;;
;; Change keymap of uim-mode
;;
(defun uim-set-keymap (map)
(setcdr (assq 'uim-mode minor-mode-map-alist)
map))
;;
;; Return current keymap of uim-mode
;;
(defun uim-get-keymap ()
(cdr (assq 'uim-mode minor-mode-map-alist)))
;;
;; Set normal keymap
;;
(defun uim-enable-mode-keymap ()
(uim-set-keymap uim-mode-map))
;;
;; Disable and return current keymap
;;
(defun uim-disable-keymap ()
(let (map)
(setq map (uim-get-keymap))
(uim-set-keymap uim-dummy-map)
map)
)
;;
;; Set preedit keymap
;;
(defun uim-enable-preedit-keymap ()
(when (not uim-preedit-keymap-enabled)
(setq uim-preedit-keymap-enabled t))
(uim-set-keymap uim-preedit-map)
(when uim-xemacs
;; disable toolbar and menubar
(make-variable-buffer-local 'toolbar-map)
(setq toolbar-map uim-toolbar-map)
(uim-xemacs-save-menubar))
)
;;
;; Unset preedit keymap
;;
(defun uim-disable-preedit-keymap ()
(when uim-preedit-keymap-enabled
(setq uim-preedit-keymap-enabled nil))
(uim-enable-other-minor-mode-map)
(uim-enable-mode-keymap)
(when uim-xemacs
;;enable toolbar and menubar
(kill-local-variable 'toolbar-map)
(uim-xemacs-restore-menubar))
)
(defun uim-reorder-minor-mode-map-alist ()
(interactive)
(let ((inhibit-quit t) member)
(setq member (assq 'uim-mode minor-mode-map-alist))
(if member
(setq minor-mode-map-alist
(cons member
(delq member minor-mode-map-alist))))))
(defun uim-reset-keymap ()
(uim-init-keymap)
(run-hooks 'uim-reset-keymap-hook))
(provide 'uim-keymap)
|