-
Notifications
You must be signed in to change notification settings - Fork 3
/
translations.el
45 lines (33 loc) · 1.66 KB
/
translations.el
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
;;; translations.el -- key translation maps -*- lexical-binding: t; -*-
;; Copyright (C) 2014-2017 Christopher R. Genovese, all rights reserved.
;; Author: Christopher Genovese <[email protected]>
;; Version: 1.2.0
;;; Commentary:
;;
;; The primary use of these maps at the moment is for Mac OS X:
;; emulating a three-button mouse, unshadowing a few keys that are
;; usually captured by the system, and setting the modifier keys
;; properly.
;;; Code:
;; Modifier keys, apparently only on OS X but keep outside just in case
(setq ns-command-modifier 'meta)
(setq ns-option-modifier 'alt)
(setq ns-function-modifier 'super)
(when (eq my-platform 'macosx)
;; Three-button-mouse emulations
(define-key key-translation-map [s-mouse-1] [mouse-2])
(define-key key-translation-map [C-s-mouse-1] [C-mouse-2])
(define-key key-translation-map [M-s-mouse-1] [M-C-mouse-2])
(define-key key-translation-map [s-S-mouse-1] [down-mouse-2])
(define-key key-translation-map [C-s-S-mouse-1] [C-down-mouse-2])
(define-key key-translation-map [M-s-S-mouse-1] [M-C-down-mouse-2])
(define-key key-translation-map [A-mouse-1] [mouse-3])
(define-key key-translation-map [C-A-mouse-1] [C-mouse-3])
(define-key key-translation-map [M-A-mouse-1] [M-C-mouse-3])
(define-key key-translation-map [A-S-mouse-1] [down-mouse-3])
(define-key key-translation-map [C-A-S-mouse-1] [C-down-mouse-3])
(define-key key-translation-map [M-A-S-mouse-1] [M-C-down-mouse-3])
;; Key unshadowing
(define-key key-translation-map [(alt ?\ )] nil)
(define-key key-translation-map [(alt ?u)] nil))
;;; translations.el ends here