diff options
author | mathias <mathias> | 2005-05-06 09:22:53 (GMT) |
---|---|---|
committer | mathias <mathias> | 2005-05-06 09:22:53 (GMT) |
commit | 6c057c6903151aab92309310087d5af455ecefce (patch) | |
tree | 1d4c98ad1637df09b89593b3e6a4a70245db4602 /src/FbTk/TextBox.cc | |
parent | 7d4f711204ab0b51d45eaff332708f529c11c9f5 (diff) | |
download | fluxbox_pavel-6c057c6903151aab92309310087d5af455ecefce.zip fluxbox_pavel-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 'src/FbTk/TextBox.cc')
-rw-r--r-- | src/FbTk/TextBox.cc | 9 |
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 | ||
211 | void TextBox::keyPressEvent(XKeyEvent &event) { | 211 | void 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]; |