[Wesnoth-bugs] [bug #20251] Non-letters not working as hotkeys

2012-10-21 Thread Galen Brooks
Follow-up Comment #1, bug #20251 (project wesnoth):

I noticed this problem too, and did some digging.  The problem is that there
is some confusion when to use the character typed, and when to use the
keycode.  I have a patch that fixes this problem.

svn diff src/hotkeys.cpp
Index: src/hotkeys.cpp
===
--- src/hotkeys.cpp (revision 55565)
+++ src/hotkeys.cpp (working copy)
@@ -468,7 +468,7 @@
n;
 
// Sometimes control modifies by -64, ie ^A == 1.
-   if (character  64  ctrl) {
+   if (0  character  character  64  ctrl  !isspace(character)) {
if (shift) {
character += 64; }
else {
@@ -652,7 +652,7 @@
 n;
 
// Sometimes control modifies by -64, ie ^A == 1.
-   if (0  character  character  64  ctrl) {
+   if (0  character  character  64  ctrl  !isspace(character)) {
if (shift) {
character += 64;
} else {
@@ -666,6 +666,13 @@
if (cmd  character  96  character  123  shift) {
character -= 32; }
 
+   if (isprint(character)  !isspace(character)) {
+   LOG_G  type = BY_CHARACTERn;
+   } else {
+   character = -1;
+   LOG_G  type = BY_KEYCODEn;
+   }
+
bool found = false;
 
for (itor = hotkeys_.begin(); itor != hotkeys_.end(); ++itor) {


___

Reply to this item at:

  http://gna.org/bugs/?20251

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #20249] Hotkeys with ALT not working correctly

2012-10-21 Thread Galen Brooks
Follow-up Comment #1, bug #20249 (project wesnoth):

While trying to figure out why CTRL+SPACE wasn't working, I found another
problem which could be causing this.  The method get_hotkey() is being used
inconsistently, swapping ctrl and alt in places.  Here's a patch showing the
problem.

Index: src/hotkeys.cpp
===
@@ -752,8 +759,8 @@
return get_hotkey(event.keysym.unicode, event.keysym.sym,
(event.keysym.mod  KMOD_SHIFT) != 0,
(event.keysym.mod  KMOD_CTRL)  != 0,
-   (event.keysym.mod  KMOD_META)  != 0,
-   (event.keysym.mod  KMOD_ALT)   != 0
+   (event.keysym.mod  KMOD_ALT)   != 0,
+   (event.keysym.mod  KMOD_META)  != 0
 #ifdef __APPLE__
|| (event.keysym.mod  KMOD_RMETA) != 0
 #endif
Index: src/hotkey_preferences_display.cpp
===
--- src/hotkey_preferences_display.cpp  (revision 55565)
+++ src/hotkey_preferences_display.cpp  (working copy)
@@ -626,8 +626,8 @@
case SDL_KEYUP:
oldhk =
hotkey::get_hotkey( character,
keycode,
-   (mod  KMOD_SHIFT) !=
0, (mod  KMOD_CTRL) != 0,
-   (mod  KMOD_LMETA) !=
0, (mod  KMOD_ALT)  != 0 );
+   (mod  KMOD_SHIFT) !=
0, (mod  KMOD_CTRL)  != 0,
+   (mod  KMOD_ALT)   !=
0, (mod  KMOD_LMETA) != 0 );
newhk.set_key(character, keycode, (mod  KMOD_SHIFT)
!= 0,
(mod  KMOD_CTRL) != 0, (mod 
KMOD_ALT) != 0,
(mod  KMOD_LMETA) != 0);


___

Reply to this item at:

  http://gna.org/bugs/?20249

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #20208] Campaigns Crash Halfway Through

2012-10-21 Thread Ishayahu
Additional Item Attachment, bug #20208 (project wesnoth):

File name: ЛВ-Последний_оплот_эль..._повтор.gz
Size:113 KB


___

Reply to this item at:

  http://gna.org/bugs/?20208

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #20251] Non-letters not working as hotkeys

2012-10-21 Thread Galen Brooks
Follow-up Comment #2, bug #20251 (project wesnoth):

The patch does not fix numbers or other keys in combination with ctrl. 
Perhaps a more general solution involves using keycodes whenever the ctrl
modifier is present, and removing the ascii conversion math.  A quick test
shows this approach is workable.

There is another problem:  the saved hotkeys all have a null command.

___

Reply to this item at:

  http://gna.org/bugs/?20251

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #20251] Non-letters not working as hotkeys

2012-10-21 Thread Galen Brooks
Follow-up Comment #3, bug #20251 (project wesnoth):

The hotkey definitions aren't being saved.  There is an inverted null check in
the save() method.

svn diff src/hotkeys.cpp 
Index: src/hotkeys.cpp
===
--- src/hotkeys.cpp (revision 55567)
+++ src/hotkeys.cpp (working copy)
@@ -569,12 +565,10 @@
for(std::vectorhotkey_item::iterator i = hotkeys_.begin();
i != hotkeys_.end(); ++i)
{
-   if (i-get_command() != null) {
+   if (i-null()) {
continue;
}

config item = cfg.add_child(hotkey);
i-save(item);
}
 }
 


___

Reply to this item at:

  http://gna.org/bugs/?20251

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #20249] Hotkeys with ALT not working correctly

2012-10-21 Thread J Tyne
Follow-up Comment #2, bug #20249 (project wesnoth):

Yes, that is the swapping that occurred in r55543. The question is why was it
done. Should it be simply reverted, or is there some reason to change the
order of parameters? (That revision was logged with the message code
cleanups, so presumably something was being improved, despite breaking a good
chunk of hotkey functionality.)

___

Reply to this item at:

  http://gna.org/bugs/?20249

___
  Message sent via/by Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs


[Wesnoth-bugs] [bug #20245] Status table scenario settings shows leader id's

2012-10-21 Thread Anonymissimus
Follow-up Comment #2, bug #20245 (project wesnoth):

What's shown there actually is the [side]save_id=, which happens to be the
leader's id in case it wasn't specified. (So one can put something better
there by setting a save_id.)
If it changes due to another leader, then that's probably bad and potentially
another bug.

___

Reply to this item at:

  http://gna.org/bugs/?20245

___
  Nachricht gesendet von/durch Gna!
  http://gna.org/


___
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs