+ m_swx->DoContextMenu(Point(pt.x, pt.y));
+}
+
+
+void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent& evt) {
+ m_swx->DoMouseWheel(evt.GetWheelRotation(),
+ evt.GetWheelDelta(),
+ evt.GetLinesPerAction(),
+ evt.ControlDown(),
+ evt.IsPageScroll());
+}
+
+
+void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) {
+ // On (some?) non-US PC keyboards the AltGr key is required to enter some
+ // common characters. It comes to us as both Alt and Ctrl down so we need
+ // to let the char through in that case, otherwise if only ctrl or only
+ // alt let's skip it.
+ bool ctrl = evt.ControlDown();
+#ifdef __WXMAC__
+ // On the Mac the Alt key is just a modifier key (like Shift) so we need
+ // to allow the char events to be processed when Alt is pressed.
+ // TODO: Should we check MetaDown instead in this case?
+ bool alt = false;
+#else
+ bool alt = evt.AltDown();
+#endif
+ bool skip = ((ctrl || alt) && ! (ctrl && alt));
+
+ if (!m_lastKeyDownConsumed && !skip) {
+#if wxUSE_UNICODE
+ int key = evt.GetUnicodeKey();
+ bool keyOk = true;
+
+ // if the unicode key code is not really a unicode character (it may
+ // be a function key or etc., the platforms appear to always give us a
+ // small value in this case) then fallback to the ascii key code but
+ // don't do anything for function keys or etc.
+ if (key <= 127) {
+ key = evt.GetKeyCode();
+ keyOk = (key <= 127);
+ }
+ if (keyOk) {
+ m_swx->DoAddChar(key);
+ return;
+ }
+#else
+ int key = evt.GetKeyCode();
+ if (key <= WXK_START || key > WXK_COMMAND) {
+ m_swx->DoAddChar(key);
+ return;
+ }
+#endif