fix failure to remove keyvalue from Keyboard::state on key release
This commit is contained in:
parent
26f1578568
commit
45cd3482a2
|
@ -309,17 +309,44 @@ Keyboard::snooper (GtkWidget *widget, GdkEventKey *event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Special keys that we want to handle in
|
if (event->type == GDK_KEY_RELEASE) {
|
||||||
any dialog, no matter whether it uses
|
|
||||||
the regular set of accelerators or not
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (event->type == GDK_KEY_RELEASE && modifier_state_equals (event->state, PrimaryModifier)) {
|
State::iterator k = find (state.begin(), state.end(), keyval);
|
||||||
switch (event->keyval) {
|
|
||||||
case GDK_w:
|
if (k != state.end()) {
|
||||||
close_current_dialog ();
|
/* this cannot change the ordering, so need to sort */
|
||||||
ret = true;
|
state.erase (k);
|
||||||
break;
|
if (state.empty()) {
|
||||||
|
DEBUG_TRACE (DEBUG::Keyboard, "no keys down\n");
|
||||||
|
} else {
|
||||||
|
#ifndef NDEBUG
|
||||||
|
if (DEBUG_ENABLED(DEBUG::Keyboard)) {
|
||||||
|
DEBUG_STR_DECL(a);
|
||||||
|
DEBUG_STR_APPEND(a, "keyboard, keys still down: ");
|
||||||
|
for (State::iterator i = state.begin(); i != state.end(); ++i) {
|
||||||
|
DEBUG_STR_APPEND(a, gdk_keyval_name (*i));
|
||||||
|
DEBUG_STR_APPEND(a, ',');
|
||||||
|
}
|
||||||
|
DEBUG_STR_APPEND(a, '\n');
|
||||||
|
DEBUG_TRACE (DEBUG::Keyboard, DEBUG_STR(a).str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* NDEBUG */
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modifier_state_equals (event->state, PrimaryModifier)) {
|
||||||
|
|
||||||
|
/* Special keys that we want to handle in
|
||||||
|
any dialog, no matter whether it uses
|
||||||
|
the regular set of accelerators or not
|
||||||
|
*/
|
||||||
|
|
||||||
|
switch (event->keyval) {
|
||||||
|
case GDK_w:
|
||||||
|
close_current_dialog ();
|
||||||
|
ret = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user