summaryrefslogtreecommitdiff
path: root/util/fbrun
diff options
context:
space:
mode:
Diffstat (limited to 'util/fbrun')
-rw-r--r--util/fbrun/FbRun.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc
index b14321b..d72d1bf 100644
--- a/util/fbrun/FbRun.cc
+++ b/util/fbrun/FbRun.cc
@@ -223,7 +223,7 @@ void FbRun::redrawLabel() {
223} 223}
224 224
225void FbRun::keyPressEvent(XKeyEvent &ke) { 225void FbRun::keyPressEvent(XKeyEvent &ke) {
226 // strip numlock, capslock and scrolllock mask 226
227 ke.state = FbTk::KeyUtil::instance().cleanMods(ke.state); 227 ke.state = FbTk::KeyUtil::instance().cleanMods(ke.state);
228 228
229 int cp= cursorPosition(); 229 int cp= cursorPosition();
@@ -232,10 +232,11 @@ void FbRun::keyPressEvent(XKeyEvent &ke) {
232 char keychar[1]; 232 char keychar[1];
233 XLookupString(&ke, keychar, 1, &ks, 0); 233 XLookupString(&ke, keychar, 1, &ks, 0);
234 // a modifier key by itself doesn't do anything 234 // a modifier key by itself doesn't do anything
235 if (IsModifierKey(ks)) return; 235 if (IsModifierKey(ks))
236 return;
236 237
237 if (ke.state) { // a modifier key is down 238 if (FbTk::KeyUtil::instance().isolateModifierMask(ke.state)) { // a modifier key is down
238 if (ke.state == ControlMask) { 239 if ((ke.state & ControlMask) == ControlMask) {
239 switch (ks) { 240 switch (ks) {
240 case XK_p: 241 case XK_p:
241 prevHistoryItem(); 242 prevHistoryItem();
@@ -248,7 +249,7 @@ void FbRun::keyPressEvent(XKeyEvent &ke) {
248 setCursorPosition(cp); 249 setCursorPosition(cp);
249 break; 250 break;
250 } 251 }
251 } else if (ke.state == (Mod1Mask | ShiftMask)) { 252 } else if ((ke.state & (Mod1Mask|ShiftMask)) == (Mod1Mask | ShiftMask)) {
252 switch (ks) { 253 switch (ks) {
253 case XK_less: 254 case XK_less:
254 firstHistoryItem(); 255 firstHistoryItem();