Commit 52fb7952ce0903949e9c1d762163dfab20743e8b
1 parent
d1648baf
Exists in
master
and in
1 other branch
Updating default accelerators.
Showing
1 changed file
with
12 additions
and
48 deletions
Show diff stats
src/terminal/keyboard/init.c
... | ... | @@ -130,8 +130,6 @@ |
130 | 130 | accelerator->arg = (gconstpointer) &actions[ix]; |
131 | 131 | accelerator->activate = G_CALLBACK(fire_lib3270_action); |
132 | 132 | |
133 | -// debug("%s=%s",actions[ix].name,keys[key]); | |
134 | - | |
135 | 133 | v3270_accelerator_parse(accelerator,keys[key]); |
136 | 134 | |
137 | 135 | accelerators = g_slist_prepend(accelerators,accelerator); |
... | ... | @@ -228,61 +226,27 @@ |
228 | 226 | |
229 | 227 | accelerators = g_slist_prepend(accelerators,v3270_pfkey_accelerator_new(key,NULL)); |
230 | 228 | |
231 | - if(key == 7) { | |
229 | + switch(key) { | |
230 | + case 7: | |
232 | 231 | accelerators = g_slist_prepend(accelerators,v3270_pfkey_accelerator_new(key,"Page_Up")); |
233 | - } else if(key == 8) { | |
232 | + break; | |
233 | + | |
234 | + case 8: | |
234 | 235 | accelerators = g_slist_prepend(accelerators,v3270_pfkey_accelerator_new(key,"Page_Down")); |
235 | - } | |
236 | + break; | |
236 | 237 | |
237 | - } | |
238 | + case 19: | |
239 | + accelerators = g_slist_prepend(accelerators,v3270_pfkey_accelerator_new(key,"<Shift>Page_Up")); | |
240 | + break; | |
238 | 241 | |
239 | - } | |
240 | - /* | |
241 | - { | |
242 | - static const struct | |
243 | - { | |
244 | - guint key; | |
245 | - GdkModifierType mods; | |
246 | - const gchar * name; | |
247 | - const gchar * description; | |
248 | - unsigned short pfkey; | |
249 | - } accels[] = | |
250 | - { | |
251 | - { | |
252 | - .key = GDK_Page_Up, | |
253 | - .name = "page-up", | |
254 | - .description = N_( "Previous page" ), | |
255 | - .pfkey = 7 | |
256 | - }, | |
257 | - { | |
258 | - .key = GDK_Page_Down, | |
259 | - .name = "page-down", | |
260 | - .description = N_( "Next page" ), | |
261 | - .pfkey = 8 | |
242 | + case 20: | |
243 | + accelerators = g_slist_prepend(accelerators,v3270_pfkey_accelerator_new(key,"<Shift>Page_Down")); | |
244 | + break; | |
262 | 245 | } |
263 | - }; | |
264 | - | |
265 | - for(ix = 0 ; ix < G_N_ELEMENTS(accels); ix++) | |
266 | - { | |
267 | - V3270PFKeyAccelerator * accelerator = g_new0(V3270PFKeyAccelerator,1); | |
268 | - | |
269 | - accelerator->keycode = accels[ix].pfkey; | |
270 | - accelerator->name = accels[ix].name; | |
271 | - accelerator->description = accels[ix].description; | |
272 | - accelerator->parent.type = V3270_ACCELERATOR_TYPE_PFKEY; | |
273 | - accelerator->parent.key = accels[ix].key; | |
274 | - accelerator->parent.mods = accels[ix].mods; | |
275 | - accelerator->parent.arg = (gconstpointer) accelerator; | |
276 | - accelerator->parent.activate = G_CALLBACK(fire_pfkey_action); | |
277 | - | |
278 | - debug("%s Accelerator(%s)=%p pfkey=%d",__FUNCTION__,accelerator->name,accelerator,accelerator->keycode); | |
279 | - | |
280 | - widget->accelerators = g_slist_prepend(widget->accelerators,accelerator); | |
281 | 246 | |
282 | 247 | } |
283 | 248 | |
284 | 249 | } |
285 | - */ | |
286 | 250 | |
287 | 251 | return v3270_accelerator_map_sort(accelerators); |
288 | 252 | ... | ... |