aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authormathias <mathias>2005-05-06 09:22:53 (GMT)
committermathias <mathias>2005-05-06 09:22:53 (GMT)
commit6c057c6903151aab92309310087d5af455ecefce (patch)
tree1d4c98ad1637df09b89593b3e6a4a70245db4602 /util
parent7d4f711204ab0b51d45eaff332708f529c11c9f5 (diff)
downloadfluxbox_paul-6c057c6903151aab92309310087d5af455ecefce.zip
fluxbox_paul-6c057c6903151aab92309310087d5af455ecefce.tar.bz2
Fix for #1160244, #1099704, #1094107:
if the xkb-extension is enabled and the user switches between his/her keyboardlayouts fluxbox's keybhandling doesn't work well anymore because xkeyevent.state contains also xkb-related flags and thus we have to handle that with caution. KeyUtils now contain 'isolateModifierMask()' to really work only on the modifiers. why not as part of cleanMods() ? because the XLookupString return false results, eg TextBox's would only print chars from the first keyboardlayout.
Diffstat (limited to 'util')
-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();