- Key(keycode, false, shiftDown, cmdDown, altDown);
- Key(keycode, true, shiftDown, cmdDown, altDown);
-
+ wxASSERT_MSG( (modifiers & wxMOD_ALTGR) != wxMOD_ALTGR,
+ "wxMOD_ALTGR is not implemented" );
+ wxASSERT_MSG( !(modifiers & wxMOD_META ),
+ "wxMOD_META is not implemented" );
+ wxASSERT_MSG( !(modifiers & wxMOD_WIN ),
+ "wxMOD_WIN is not implemented" );
+
+ if ( isDown )
+ SimulateModifiers(modifiers, true);
+
+ bool rc = DoKey(keycode, modifiers, isDown);
+
+ if ( !isDown )
+ SimulateModifiers(modifiers, false);
+
+ return rc;
+}
+
+void wxUIActionSimulator::SimulateModifiers(int modifiers, bool isDown)
+{
+ if ( modifiers & wxMOD_SHIFT )
+ DoKey(WXK_SHIFT, modifiers, isDown);
+ if ( modifiers & wxMOD_ALT )
+ DoKey(WXK_ALT, modifiers, isDown);
+ if ( modifiers & wxMOD_CONTROL )
+ DoKey(WXK_CONTROL, modifiers, isDown);
+}
+
+bool wxUIActionSimulator::Char(int keycode, int modifiers)
+{
+ Key(keycode, modifiers, true);
+ Key(keycode, modifiers, false);
+