1@binding-set gtk-mac-alt-arrows
2{
3  bind "<alt>Right"           { "move-cursor" (words, 1, 0) };
4  bind "<alt>KP_Right"        { "move-cursor" (words, 1, 0) };
5  bind "<alt>Left"            { "move-cursor" (words, -1, 0) };
6  bind "<alt>KP_Left"         { "move-cursor" (words, -1, 0) };
7  bind "<shift><alt>Right"    { "move-cursor" (words, 1, 1) };
8  bind "<shift><alt>KP_Right" { "move-cursor" (words, 1, 1) };
9  bind "<shift><alt>Left"     { "move-cursor" (words, -1, 1) };
10  bind "<shift><alt>KP_Left"  { "move-cursor" (words, -1, 1) };
11}
12
13@binding-set gtk-mac-alt-delete
14{
15  bind "<alt>Delete" { "delete-from-cursor" (word-ends, 1) };
16  bind "<alt>KP_Delete" { "delete-from-cursor" (word-ends, 1) };
17  bind "<alt>BackSpace" { "delete-from-cursor" (word-ends, -1) };
18}
19
20@binding-set gtk-mac-cmd-c
21{
22  bind "<meta>x" { "cut-clipboard" () };
23  bind "<meta>c" { "copy-clipboard" () };
24  bind "<meta>v" { "paste-clipboard" () };
25  unbind "<ctrl>x";
26  unbind "<ctrl>c";
27  unbind "<ctrl>v";
28}
29
30@binding-set gtk-mac-text-view
31{
32  bind "<shift><meta>a" { "select-all" (0) };
33  bind "<meta>a" { "select-all" (1) };
34  unbind "<shift><ctrl>a";
35  unbind "<ctrl>a";
36}
37
38@binding-set gtk-mac-label
39{
40  bind "<meta>a" {
41    "move-cursor" (paragraph-ends, -1, 0)
42    "move-cursor" (paragraph-ends, 1, 1)
43  };
44  bind "<shift><meta>a" { "move-cursor" (paragraph-ends, 0, 0) };
45  bind "<meta>c" { "copy-clipboard" () };
46  unbind "<ctrl>a";
47  unbind "<shift><ctrl>a";
48  unbind "<ctrl>c";
49}
50
51@binding-set gtk-mac-entry
52{
53  bind "<meta>a" {
54    "move-cursor" (buffer-ends, -1, 0)
55    "move-cursor" (buffer-ends, 1, 1)
56  };
57  bind "<shift><meta>a" { "move-cursor" (visual-positions, 0, 0) };
58  unbind "<ctrl>a";
59  unbind "<shift><ctrl>a";
60}
61
62@binding-set gtk-mac-cmd-arrows
63{
64  bind "<meta>Left" { "move-cursor" (paragraph-ends, -1, 0) };
65  bind "<meta>KP_Left" { "move-cursor" (paragraph-ends, -1, 0) };
66  bind "<shift><meta>Left" { "move-cursor" (paragraph-ends, -1, 1) };
67  bind "<shift><meta>KP_Left" { "move-cursor" (paragraph-ends, -1, 1) };
68  bind "<meta>Right" { "move-cursor" (paragraph-ends, 1, 0) };
69  bind "<meta>KP_Right" { "move-cursor" (paragraph-ends, 1, 0) };
70  bind "<shift><meta>Right" { "move-cursor" (paragraph-ends, 1, 1) };
71  bind "<shift><meta>KP_Right" { "move-cursor" (paragraph-ends, 1, 1) };
72}
73
74@binding-set gtk-mac-emacs-like
75{
76  bind "<ctrl>a" { "move-cursor" (paragraph-ends, -1, 0) };
77  bind "<shift><ctrl>a" { "move-cursor" (paragraph-ends, -1, 1) };
78  bind "<ctrl>e" { "move-cursor" (paragraph-ends, 1, 0) };
79  bind "<shift><ctrl>e" { "move-cursor" (paragraph-ends, 1, 1) };
80
81  bind "<ctrl>b" { "move-cursor" (logical-positions, -1, 0) };
82  bind "<shift><ctrl>b" { "move-cursor" (logical-positions, -1, 1) };
83  bind "<ctrl>f" { "move-cursor" (logical-positions, 1, 0) };
84  bind "<shift><ctrl>f" { "move-cursor" (logical-positions, 1, 1) };
85}
86
87@binding-set gtk-mac-file-chooser
88{
89  bind "<meta>v" { "location-popup-on-paste" () };
90  unbind "<ctrl>v";
91
92  bind "<meta><shift>G" { "location-popup" () };
93  bind "<meta><shift>H" { "home-folder" () };
94  bind "<meta>Up" { "up-folder" () };
95}
96
97@binding-set gtk-mac-tree-view
98{
99  bind "<meta>a" { "select-all" () };
100  bind "<shift><meta>a" { "unselect-all" () };
101  bind "<meta>f" { "start-interactive-search" () };
102  bind "<meta>F" { "start-interactive-search" () };
103  unbind "<ctrl>a";
104  unbind "<shift><ctrl>a";
105  unbind "<ctrl>f";
106  unbind "<ctrl>F";
107}
108
109@binding-set gtk-mac-icon-view
110{
111  bind "<meta>a" { "select-all" () };
112  bind "<shift><meta>a" { "unselect-all" () };
113  unbind "<ctrl>a";
114  unbind "<shift><ctrl>a";
115}
116
117iconview {
118  -gtk-key-bindings: gtk-mac-icon-view;
119}
120
121textview {
122  -gtk-key-bindings: gtk-mac-alt-arrows, gtk-mac-alt-delete, gtk-mac-cmd-c, gtk-mac-cmd-arrows, gtk-mac-emacs-like, gtk-mac-text-view;
123}
124
125entry {
126  -gtk-key-bindings: gtk-mac-alt-arrows, gtk-mac-alt-delete, gtk-mac-cmd-c, gtk-mac-cmd-arrows, gtk-mac-emacs-like, gtk-mac-entry;
127}
128
129label {
130  -gtk-key-bindings: gtk-mac-alt-arrows, gtk-mac-cmd-arrows, gtk-mac-emacs-like, gtk-mac-label;
131}
132
133GtkFileChooserWidget {
134  -gtk-key-bindings: gtk-mac-file-chooser;
135}
136
137treeview {
138  -gtk-key-bindings: gtk-mac-tree-view;
139}
140