comparison libgui/src/m-editor/octave-qscintilla.cc @ 18976:dcb260e7a648

maint: Periodic merge of gui-release to default.
author John W. Eaton <jwe@octave.org>
date Fri, 01 Aug 2014 12:10:05 -0400
parents 888f8ce79bbe c6b89c4a9e63
children
comparison
equal deleted inserted replaced
18972:19cb2530c16b 18976:dcb260e7a648
96 case Qt::Key_T | Qt::CTRL | Qt::SHIFT : // LineCopy 96 case Qt::Key_T | Qt::CTRL | Qt::SHIFT : // LineCopy
97 cmd_list.at (i)->setKey (0); 97 cmd_list.at (i)->setKey (0);
98 } 98 }
99 } 99 }
100 #endif 100 #endif
101
102 #if defined (Q_OS_MAC)
103 // Octave interprets Cmd key as Meta whereas Qscintilla interprets it
104 // as Ctrl. We thus invert Meta/Ctrl in Qscintilla's shortcuts list.
105 QList< QsciCommand * > cmd_list_mac = cmd_set->commands ();
106 for (int i = 0; i < cmd_list_mac.length (); i++)
107 {
108 // Primary key
109 int key = cmd_list_mac.at (i)->key ();
110
111 if (static_cast<int> (key | Qt::META) == key &&
112 static_cast<int> (key | Qt::CTRL) != key)
113 key = (key ^ Qt::META) | Qt::CTRL;
114 else if (static_cast<int> (key | Qt::CTRL) == key)
115 key = (key ^ Qt::CTRL) | Qt::META;
116
117 cmd_list_mac.at (i)->setKey (key);
118
119 // Alternate key
120 key = cmd_list_mac.at (i)->alternateKey ();
121
122 if (static_cast<int> (key | Qt::META) == key &&
123 static_cast<int> (key | Qt::CTRL) != key)
124 key = (key ^ Qt::META) | Qt::CTRL;
125 else if (static_cast<int> (key | Qt::CTRL) == key)
126 key = (key ^ Qt::CTRL) | Qt::META;
127
128 cmd_list_mac.at (i)->setAlternateKey (key);
129 }
130 #endif
101 } 131 }
102 132
103 octave_qscintilla::~octave_qscintilla () 133 octave_qscintilla::~octave_qscintilla ()
104 { } 134 { }
105 135