Re: [Freeciv-Dev] (PR#12188) Alt-t key does not work
URL: http://bugs.freeciv.org/Ticket/Display.html?id=12188 William Allen Simpson wrote: Should this new undocumented feature be added to 2.1? No need to change 2.1 here. -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#12188) Alt-t key does not work
URL: http://bugs.freeciv.org/Ticket/Display.html?id=12188 Hello, Du schriebst am 11. Dec um 01:22 Uhr: It's a keyboard command in 2.1. If it had been fixed 2 years ago, that would have been a good time to change it. Now, it's embedded in the help system and translations. Let's keep the eye on the prize here. Waiting for the German translator to verify whether it fixes his bug report. Things have changed since 2005, maybe in the code, in the translations, and - during last days - on my system, too, with an update from Sarge to Etch. Now, with you patch, I have no Alt-t mnemonic in the menues any more. More important, the Alt-t command for the main map (mouse cursor hovering over it) does not do anything at all. Worse, the numpad cursor keys for moving units do not work, sometimes. Seems related to what keys I pressed before. Christian -- Christian Knoke* * *http://cknoke.de * * * * * * * * * Ceterum censeo Microsoft esse dividendum. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#12188) Alt-t key does not work
URL: http://bugs.freeciv.org/Ticket/Display.html?id=12188 Christian Knoke wrote: important, the Alt-t command for the main map (mouse cursor hovering over it) does not do anything at all. Worse, the numpad cursor keys for moving OK, the t-command does that hilite thing. OK, good. Before, Alt-t, control-t, and 't' all did the hilite thing. But I thought you had an Alt-t menu or dialog item, and that was what needs to be tested. Should work now, just wanted confirmation. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#12188) Alt-t key does not work
URL: http://bugs.freeciv.org/Ticket/Display.html?id=12188 important, the Alt-t command for the main map (mouse cursor hovering over it) does not do anything at all. Worse, the numpad cursor keys for moving OK, the t-command does that hilite thing. Christian -- Christian Knoke* * *http://cknoke.de * * * * * * * * * Ceterum censeo Microsoft esse dividendum. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#12188) Alt-t key does not work
URL: http://bugs.freeciv.org/Ticket/Display.html?id=12188 Looking at Jason's suggestion for 2.2 and beyond, CONTROL+SHIFT+LMB toggles workers on the main map. So, it makes some sense for this to be CONTROL+SHIFT+RMB (instead of 't') to show the overlay. Committed trunk revision 14156. Committed S2_2 revision 14157. Should this new undocumented feature be added to 2.1? Should the old 't' be removed entirely? This would require a change to one very long translation msgid (and the end of the translations would no longer make any sense). It would also be removed from xaw (and isn't implemented in other clients). BTW, whatever we choose, the overlay doesn't accurately show changes made using the mouse toggled workers Blech! trunk/2.2 patch for posterity: Index: client/gui-gtk-2.0/gui_main.c === --- client/gui-gtk-2.0/gui_main.c (revision 14155) +++ client/gui-gtk-2.0/gui_main.c (working copy) @@ -615,10 +615,6 @@ key_cancel_action(); return TRUE; - case GDK_t: -key_city_workers(w, ev); -return TRUE; - default: break; }; Index: client/gui-gtk-2.0/mapctrl.c === --- client/gui-gtk-2.0/mapctrl.c(revision 14155) +++ client/gui-gtk-2.0/mapctrl.c(working copy) @@ -290,14 +290,22 @@ case 3: /* RIGHT mouse button */ +/* SHIFT + CONTROL + RMB : Show/hide workers. */ +if ((ev-state GDK_SHIFT_MASK) (ev-state GDK_CONTROL_MASK)) { + if (NULL != pcity) { +overlay_workers_at_city(); + } +} /* CONTROL + RMB : Quickselect a land unit. */ -if (ev-state GDK_CONTROL_MASK) { +else if (ev-state GDK_CONTROL_MASK) { action_button_pressed(ev-x, ev-y, SELECT_LAND); } /* SHIFT + RMB: Paste Production. */ -else if ((ev-state GDK_SHIFT_MASK) pcity) { - clipboard_paste_production(pcity); - cancel_tile_hiliting(); +else if ((ev-state GDK_SHIFT_MASK)) { + if (NULL != pcity) { +clipboard_paste_production(pcity); +cancel_tile_hiliting(); + } } /* Plain RMB click. */ else { @@ -448,7 +456,7 @@ } /** - Draws the on the map the tiles the given city is using + Best effort to center the map on the currently selected unit(s) **/ void center_on_unit(void) { @@ -456,9 +464,9 @@ } /** - Draws the on the map the tiles the given city is using + Shows/hides overlay on the map for the city at this location **/ -void key_city_workers(GtkWidget *w, GdkEventKey *ev) +void overlay_workers_at_city(void) { int x, y; Index: client/gui-gtk-2.0/mapctrl.h === --- client/gui-gtk-2.0/mapctrl.h(revision 14155) +++ client/gui-gtk-2.0/mapctrl.h(working copy) @@ -19,8 +19,6 @@ #include mapctrl_g.h -void key_city_workers(GtkWidget *w, GdkEventKey *ev); - gboolean butt_release_mapcanvas(GtkWidget *w, GdkEventButton *ev, gpointer data); gboolean butt_down_mapcanvas(GtkWidget *w, GdkEventButton *ev, gpointer data); gboolean butt_down_overviewcanvas(GtkWidget *w, GdkEventButton *ev, gpointer data); @@ -29,6 +27,8 @@ gboolean move_overviewcanvas(GtkWidget *w, GdkEventMotion *ev, gpointer data); void center_on_unit(void); +void overlay_workers_at_city(void); + void popupinfo_popdown_callback(GtkWidget *w, gpointer data); #endif /* FC__MAPCTRL_H */ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#12188) Alt-t key does not work
URL: http://bugs.freeciv.org/Ticket/Display.html?id=12188 Jason Dorje Short wrote: This command depends on the mouse location - maybe it should be a mouse click and not a keyboard command? Perhaps it should -- in 2.2 -- but that would be a different report. It's a keyboard command in 2.1. If it had been fixed 2 years ago, that would have been a good time to change it. Now, it's embedded in the help system and translations. Let's keep the eye on the prize here. Waiting for the German translator to verify whether it fixes his bug report. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#12188) Alt-t key does not work
URL: http://bugs.freeciv.org/Ticket/Display.html?id=12188 As I recently discovered, GDK_t (the letter t) was hijacked in client/gui-gtk-2.0/gui_main.c keyboard_handler(), just as GDK_escape (PR#39924), and a host of others. That breaks every keyboard + 't' combination. This puts it in a menu, using the menu string from SDL, so no new translation is needed. Not perfect, but better than nothing Dunno why nobody fixed this in 2 years. Hopefully, this fixes the Alt-t problem for you. (Cannot test, have no Alt-t commands in English.) So, I'll commit immediately, for everybody else to test. Committed S2_1 revision 14151. Index: client/gui-gtk-2.0/gui_main.c === --- client/gui-gtk-2.0/gui_main.c (revision 14150) +++ client/gui-gtk-2.0/gui_main.c (working copy) @@ -542,10 +542,6 @@ key_cancel_action(); return TRUE; - case GDK_t: -key_city_workers(w, ev); -return TRUE; - default: break; }; Index: client/gui-gtk-2.0/menu.c === --- client/gui-gtk-2.0/menu.c (revision 14150) +++ client/gui-gtk-2.0/menu.c (working copy) @@ -100,6 +100,7 @@ MENU_VIEW_SHOW_CITY_NAMES, MENU_VIEW_SHOW_CITY_GROWTH_TURNS, MENU_VIEW_SHOW_CITY_PRODUCTIONS, + MENU_VIEW_SHOW_CITY_WORKERS, MENU_VIEW_SHOW_TERRAIN, MENU_VIEW_SHOW_COASTLINE, MENU_VIEW_SHOW_ROADS_RAILS, @@ -321,6 +322,9 @@ if (draw_city_productions ^ GTK_CHECK_MENU_ITEM(widget)-active) key_city_productions_toggle(); break; + case MENU_VIEW_SHOW_CITY_WORKERS: +key_city_workers(); +break; case MENU_VIEW_SHOW_TERRAIN: if (draw_terrain ^ GTK_CHECK_MENU_ITEM(widget)-active) { key_terrain_toggle(); @@ -764,10 +768,11 @@ { / N_(View) / N_(City _Names), controln, view_menu_callback, MENU_VIEW_SHOW_CITY_NAMES, CheckItem }, { / N_(View) / N_(City G_rowth), controlr, - view_menu_callback, MENU_VIEW_SHOW_CITY_GROWTH_TURNS, - CheckItem }, + view_menu_callback, MENU_VIEW_SHOW_CITY_GROWTH_TURNS, CheckItem }, { / N_(View) / N_(City _Productions),controlp, view_menu_callback, MENU_VIEW_SHOW_CITY_PRODUCTIONS, CheckItem }, + { / N_(View) / N_(Draw city worker map grid),t, +view_menu_callback, MENU_VIEW_SHOW_CITY_WORKERS }, { / N_(View) /sep1,NULL, NULL, 0, Separator }, { / N_(View) / N_(Terrain), NULL, Index: client/gui-gtk-2.0/mapctrl.c === --- client/gui-gtk-2.0/mapctrl.c(revision 14150) +++ client/gui-gtk-2.0/mapctrl.c(working copy) @@ -458,7 +458,7 @@ /** Draws the on the map the tiles the given city is using **/ -void key_city_workers(GtkWidget *w, GdkEventKey *ev) +void key_city_workers(void) { int x, y; Index: client/gui-gtk-2.0/mapctrl.h === --- client/gui-gtk-2.0/mapctrl.h(revision 14150) +++ client/gui-gtk-2.0/mapctrl.h(working copy) @@ -19,8 +19,6 @@ #include mapctrl_g.h -void key_city_workers(GtkWidget *w, GdkEventKey *ev); - gboolean butt_release_mapcanvas(GtkWidget *w, GdkEventButton *ev, gpointer data); gboolean butt_down_mapcanvas(GtkWidget *w, GdkEventButton *ev, gpointer data); gboolean butt_down_overviewcanvas(GtkWidget *w, GdkEventButton *ev, gpointer data); @@ -29,6 +27,8 @@ gboolean move_overviewcanvas(GtkWidget *w, GdkEventMotion *ev, gpointer data); void center_on_unit(void); +void key_city_workers(void); + void popupinfo_popdown_callback(GtkWidget *w, gpointer data); #endif /* FC__MAPCTRL_H */ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#12188) Alt-t key does not work
URL: http://bugs.freeciv.org/Ticket/Display.html?id=12188 William Allen Simpson wrote: This puts it in a menu, using the menu string from SDL, so no new translation is needed. Not perfect, but better than nothing Dunno why nobody fixed this in 2 years. I considered doing this a long time ago. The problem is that when used from the menu it will do nothing, or at least it will not do anything like what you might expect it to do. This command depends on the mouse location - maybe it should be a mouse click and not a keyboard command? -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev