aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/TextBox.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/TextBox.cc')
-rw-r--r--src/FbTk/TextBox.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/FbTk/TextBox.cc b/src/FbTk/TextBox.cc
index 0db8856..2ebd6c0 100644
--- a/src/FbTk/TextBox.cc
+++ b/src/FbTk/TextBox.cc
@@ -209,7 +209,7 @@ void TextBox::buttonPressEvent(XButtonEvent &event) {
209} 209}
210 210
211void TextBox::keyPressEvent(XKeyEvent &event) { 211void TextBox::keyPressEvent(XKeyEvent &event) {
212 // strip numlock and scrolllock mask 212
213 event.state = KeyUtil::instance().cleanMods(event.state); 213 event.state = KeyUtil::instance().cleanMods(event.state);
214 214
215 KeySym ks; 215 KeySym ks;
@@ -218,8 +218,8 @@ void TextBox::keyPressEvent(XKeyEvent &event) {
218 // a modifier key by itself doesn't do anything 218 // a modifier key by itself doesn't do anything
219 if (IsModifierKey(ks)) return; 219 if (IsModifierKey(ks)) return;
220 220
221 if (event.state) { // handle keybindings with state 221 if (FbTk::KeyUtil::instance().isolateModifierMask(event.state)) { // handle keybindings with state
222 if (event.state == ControlMask) { 222 if ((event.state & ControlMask) == ControlMask) {
223 223
224 switch (ks) { 224 switch (ks) {
225 case XK_b: 225 case XK_b:
@@ -248,7 +248,8 @@ void TextBox::keyPressEvent(XKeyEvent &event) {
248 m_end_pos = 0; 248 m_end_pos = 0;
249 break; 249 break;
250 } 250 }
251 } else if (event.state == ShiftMask || event.state == 0x80) { // shif and altgr 251 } else if ((event.state & ShiftMask)== ShiftMask ||
252 (event.state & 0x80) == 0x80) { // shif and altgr
252 if (isprint(keychar[0])) { 253 if (isprint(keychar[0])) {
253 std::string val; 254 std::string val;
254 val += keychar[0]; 255 val += keychar[0];