wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src/widgets textbox.cpp


From: Philippe Plantier
Subject: [Wesnoth-cvs-commits] wesnoth/src/widgets textbox.cpp
Date: Tue, 13 Sep 2005 15:58:34 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Philippe Plantier <address@hidden>      05/09/13 19:58:34

Modified files:
        src/widgets    : textbox.cpp 

Log message:
        Fixed #14377 (windows shortcuts being used in the textboxes, on MacOS)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/textbox.cpp.diff?tr1=1.85&tr2=1.86&r1=text&r2=text

Patches:
Index: wesnoth/src/widgets/textbox.cpp
diff -u wesnoth/src/widgets/textbox.cpp:1.85 
wesnoth/src/widgets/textbox.cpp:1.86
--- wesnoth/src/widgets/textbox.cpp:1.85        Sun Aug 21 15:24:37 2005
+++ wesnoth/src/widgets/textbox.cpp     Tue Sep 13 19:58:34 2005
@@ -1,4 +1,4 @@
-/* $Id: textbox.cpp,v 1.85 2005/08/21 15:24:37 gruikya Exp $ */
+/* $Id: textbox.cpp,v 1.86 2005/09/13 19:58:34 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -346,6 +346,16 @@
        selstart_ = selend_ = -1;
 }
 
+namespace {
+       const unsigned int copypaste_modifier = 
+#ifdef __APPLE__
+               KMOD_LMETA | KMOD_RMETA
+#else
+               KMOD_CTRL
+#endif
+               ;
+}
+
 void textbox::handle_event(const SDL_Event& event)
 {
        scrollarea::handle_event(event);
@@ -438,10 +448,10 @@
        if(c == SDLK_RIGHT && cursor_ < text_.size())
                ++cursor_;
 
-       if(c == SDLK_END || (c == SDLK_e && (modifiers & KMOD_CTRL)))
+       if(c == SDLK_END || (c == SDLK_e && (modifiers & copypaste_modifier)))
                cursor_ = text_.size();
 
-       if(c == SDLK_HOME || (c == SDLK_a && (modifiers & KMOD_CTRL)))
+       if(c == SDLK_HOME || (c == SDLK_a && (modifiers & copypaste_modifier)))
                cursor_ = 0;
 
        if((old_cursor != cursor_) && (modifiers & KMOD_SHIFT)) {
@@ -460,7 +470,7 @@
                }
        }
 
-       if(c == SDLK_u && (modifiers & KMOD_CTRL)) {
+       if(c == SDLK_u && (modifiers & copypaste_modifier)) {
                changed = true;
                cursor_ = 0;
                text_.resize(0);
@@ -489,7 +499,7 @@
                if(character != 0)
                        LOG_STREAM(info, display) << "Char: " << character << 
", c = " << c << "\n";
 
-               if(event.key.keysym.mod & KMOD_CTRL) {
+               if(event.key.keysym.mod & copypaste_modifier) {
                        switch(c) {
                        case SDLK_v:
                                {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]