Commit 7d357cec4038b20c842d875f50d471e42fd1de5e
1 parent
c7e72e0e
Exists in
master
and in
1 other branch
Adding more accelerators.
Showing
1 changed file
with
36 additions
and
12 deletions
Show diff stats
src/terminal/keyboard/init.c
@@ -40,9 +40,14 @@ | @@ -40,9 +40,14 @@ | ||
40 | #define GDK_NUMLOCK_MASK GDK_MOD2_MASK | 40 | #define GDK_NUMLOCK_MASK GDK_MOD2_MASK |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | + #ifndef GDK_ALT_MASK | ||
44 | + #define GDK_ALT_MASK GDK_MOD1_MASK | ||
45 | + #endif | ||
46 | + | ||
43 | /*--[ Globals ]--------------------------------------------------------------------------------------*/ | 47 | /*--[ Globals ]--------------------------------------------------------------------------------------*/ |
44 | 48 | ||
45 | static int fire_keypad_action(GtkWidget *widget, const struct InternalAction * action); | 49 | static int fire_keypad_action(GtkWidget *widget, const struct InternalAction * action); |
50 | + static int fire_zoom_action(GtkWidget *widget, const struct InternalAction * action); | ||
46 | 51 | ||
47 | static const struct InternalAction InternalActions[] = | 52 | static const struct InternalAction InternalActions[] = |
48 | { | 53 | { |
@@ -68,15 +73,13 @@ | @@ -68,15 +73,13 @@ | ||
68 | .activate = G_CALLBACK(fire_copy_accelerator) | 73 | .activate = G_CALLBACK(fire_copy_accelerator) |
69 | }, | 74 | }, |
70 | 75 | ||
71 | - /* | ||
72 | { | 76 | { |
73 | .operation = V3270_COPY_APPEND, | 77 | .operation = V3270_COPY_APPEND, |
74 | .name = "copy-append", | 78 | .name = "copy-append", |
75 | .key = 'c', | 79 | .key = 'c', |
76 | - .mods = GDK_CONTROL_MASK|GDK_ALT_MASK, | 80 | + .mods = GDK_ALT_MASK, |
77 | .activate = G_CALLBACK(fire_copy_accelerator) | 81 | .activate = G_CALLBACK(fire_copy_accelerator) |
78 | }, | 82 | }, |
79 | - */ | ||
80 | 83 | ||
81 | { | 84 | { |
82 | .operation = V3270_COPY_TEXT, | 85 | .operation = V3270_COPY_TEXT, |
@@ -94,15 +97,13 @@ | @@ -94,15 +97,13 @@ | ||
94 | .activate = G_CALLBACK(fire_copy_accelerator) | 97 | .activate = G_CALLBACK(fire_copy_accelerator) |
95 | }, | 98 | }, |
96 | 99 | ||
97 | - /* | ||
98 | { | 100 | { |
99 | .operation = ACCEL_OPERATION_CUT|V3270_COPY_APPEND, | 101 | .operation = ACCEL_OPERATION_CUT|V3270_COPY_APPEND, |
100 | .name = "cut-append", | 102 | .name = "cut-append", |
101 | - .key = 0, | ||
102 | - .mods = 0, | 103 | + .key = 'x', |
104 | + .mods = GDK_ALT_MASK, | ||
103 | .activate = G_CALLBACK(fire_copy_accelerator) | 105 | .activate = G_CALLBACK(fire_copy_accelerator) |
104 | }, | 106 | }, |
105 | - */ | ||
106 | 107 | ||
107 | { | 108 | { |
108 | .operation = ACCEL_OPERATION_DEFAULT, | 109 | .operation = ACCEL_OPERATION_DEFAULT, |
@@ -112,12 +113,29 @@ | @@ -112,12 +113,29 @@ | ||
112 | .activate = G_CALLBACK(fire_paste_accelerator) | 113 | .activate = G_CALLBACK(fire_paste_accelerator) |
113 | }, | 114 | }, |
114 | 115 | ||
115 | - /* | ||
116 | - <accelerator action='zoom' mode='in' key='<ctrl>KP_Add' group='online' /> | ||
117 | - <accelerator action='zoom' mode='out' key='<ctrl>KP_Subtract' group='online' /> | ||
118 | - <accelerator action='zoom' mode='fit' key='<ctrl>0' group='online' /> | ||
119 | - */ | 116 | + { |
117 | + .operation = 0, | ||
118 | + .name = "zoom-in", | ||
119 | + .key = GDK_KP_Add, | ||
120 | + .mods = GDK_CONTROL_MASK, | ||
121 | + .activate = G_CALLBACK(fire_zoom_action) | ||
122 | + }, | ||
123 | + | ||
124 | + { | ||
125 | + .operation = 1, | ||
126 | + .name = "zoom-out", | ||
127 | + .key = GDK_KP_Subtract, | ||
128 | + .mods = GDK_CONTROL_MASK, | ||
129 | + .activate = G_CALLBACK(fire_zoom_action) | ||
130 | + }, | ||
120 | 131 | ||
132 | + { | ||
133 | + .operation = 2, | ||
134 | + .name = "zoom-fit-best", | ||
135 | + .key = '0', | ||
136 | + .mods = GDK_CONTROL_MASK, | ||
137 | + .activate = G_CALLBACK(fire_zoom_action) | ||
138 | + }, | ||
121 | 139 | ||
122 | }; | 140 | }; |
123 | 141 | ||
@@ -166,6 +184,12 @@ | @@ -166,6 +184,12 @@ | ||
166 | 184 | ||
167 | } | 185 | } |
168 | 186 | ||
187 | + static int fire_zoom_action(GtkWidget *widget, const struct InternalAction * action) | ||
188 | + { | ||
189 | + debug("%s",__FUNCTION__); | ||
190 | + return 0; | ||
191 | + } | ||
192 | + | ||
169 | void v3270_init_accelerators(v3270 *widget) | 193 | void v3270_init_accelerators(v3270 *widget) |
170 | { | 194 | { |
171 | size_t ix; | 195 | size_t ix; |