Index: gtk2_ardour/editor_ops.cc
===================================================================
--- gtk2_ardour/editor_ops.cc	(Revision 5516)
+++ gtk2_ardour/editor_ops.cc	(Arbeitskopie)
@@ -6243,10 +6243,8 @@
 void
 Editor::start_visual_state_op (uint32_t n)
 {
-	cerr << "Start visual op\n";
 	if (visual_state_op_connection.empty()) {
 		visual_state_op_connection = Glib::signal_timeout().connect (bind (mem_fun (*this, &Editor::end_visual_state_op), n), 1000);
-		cerr << "\tqueued new timeout\n";
 	}
 }
 
@@ -6254,11 +6252,13 @@
 Editor::cancel_visual_state_op (uint32_t n)
 {
 	if (!visual_state_op_connection.empty()) {
-		cerr << "cancel visual op, time to goto\n";
 		visual_state_op_connection.disconnect();
 		goto_visual_state (n);
 	} else {
-		cerr << "cancel visual op, do nothing\n";
+		//we land here if called from the menu OR if end_visual_state_op has been called
+		//so check if we are already in visual state n
+		// XXX not yet checking it at all, but redoing does not hurt
+		goto_visual_state (n);
 	}
 }
 
Index: gtk2_ardour/keyboard.cc
===================================================================
--- gtk2_ardour/keyboard.cc	(Revision 5516)
+++ gtk2_ardour/keyboard.cc	(Arbeitskopie)
@@ -233,7 +233,7 @@
 
 				const AccelKey& ak (k->first);
 				
-				if (keyval == ak.get_key() && (Gdk::ModifierType)(event->state | Gdk::RELEASE_MASK) == ak.get_mod()) {
+				if (keyval == ak.get_key() && (Gdk::ModifierType)(event->state & Keyboard::RelevantModifierKeyMask | Gdk::RELEASE_MASK) == ak.get_mod()) {
 					ret = true;
 					break;
 				}
@@ -254,7 +254,7 @@
 			const AccelKey& ak (k->first);
 			two_strings ts (k->second);
 
-			if (keyval == ak.get_key() && (Gdk::ModifierType)(event->state | Gdk::RELEASE_MASK) == ak.get_mod()) {
+			if (keyval == ak.get_key() &&  (event->state & Keyboard::RelevantModifierKeyMask | Gdk::RELEASE_MASK) == ak.get_mod()) {
 				Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (ts.first.c_str(), ts.second.c_str());
 				if (act) {
 					act->activate();
