make wxKeyEvent could get unicode key under x11, add a x11 keysym--unicode char map tab

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-09-23 17:43:37 +00:00
parent 3873c4db75
commit ad84d9f97d
5 changed files with 1740 additions and 1 deletions

View File

@ -30,6 +30,13 @@ typedef unsigned long WXKeySym;
int wxCharCodeXToWX(WXKeySym keySym);
WXKeySym wxCharCodeWXToX(int id);
int wxUnicodeCharXToWX(WXKeySym keySym);
// Xlib keysym-unicode charactor pair
struct CodePair {
unsigned int keySym;
int uniChar;
};
class wxIconBundle;

File diff suppressed because it is too large Load Diff

View File

@ -1612,7 +1612,11 @@ bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Window WXUNUSED(win
KeySym keySym;
(void) XLookupString ((XKeyEvent *) xevent, buf, 20, &keySym, NULL);
int id = wxCharCodeXToWX (keySym);
#if wxUSE_UNICODE
int id = wxUnicodeCharXToWX(keySym);
#else
int id = wxCharCodeXToWX(keySym);
#endif
// id may be WXK_xxx code - these are outside ASCII range, so we
// can't just use toupper() on id.
// Only change this if we want the raw key that was pressed,
@ -1627,7 +1631,11 @@ bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Window WXUNUSED(win
wxevent.m_altDown = XKeyEventAltIsDown(xevent);
wxevent.m_metaDown = XKeyEventMetaIsDown(xevent);
wxevent.SetEventObject(win);
#if wxUSE_UNICODE
wxevent.m_uniChar = id;
#endif
wxevent.m_keyCode = id;
wxevent.SetTimestamp(XKeyEventGetTime(xevent));
wxevent.m_x = XKeyEventGetX(xevent);

View File

@ -415,6 +415,7 @@ void ListBaseTestCase::EditLabel()
wxUIActionSimulator sim;
list->EditLabel(0);
wxYield();
sim.Text("sometext");
wxYield();

View File

@ -73,6 +73,7 @@ void RadioButtonTestCase::Click()
EventCounter selected(m_radio, wxEVT_RADIOBUTTON);
wxUIActionSimulator sim;
wxYield();
sim.MouseMove(m_radio->GetScreenPosition() + wxPoint(10, 10));
sim.MouseClick();