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:
@@ -30,6 +30,13 @@ typedef unsigned long WXKeySym;
|
|||||||
|
|
||||||
int wxCharCodeXToWX(WXKeySym keySym);
|
int wxCharCodeXToWX(WXKeySym keySym);
|
||||||
WXKeySym wxCharCodeWXToX(int id);
|
WXKeySym wxCharCodeWXToX(int id);
|
||||||
|
int wxUnicodeCharXToWX(WXKeySym keySym);
|
||||||
|
|
||||||
|
// Xlib keysym-unicode charactor pair
|
||||||
|
struct CodePair {
|
||||||
|
unsigned int keySym;
|
||||||
|
int uniChar;
|
||||||
|
};
|
||||||
|
|
||||||
class wxIconBundle;
|
class wxIconBundle;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1612,7 +1612,11 @@ bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Window WXUNUSED(win
|
|||||||
|
|
||||||
KeySym keySym;
|
KeySym keySym;
|
||||||
(void) XLookupString ((XKeyEvent *) xevent, buf, 20, &keySym, NULL);
|
(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
|
// id may be WXK_xxx code - these are outside ASCII range, so we
|
||||||
// can't just use toupper() on id.
|
// can't just use toupper() on id.
|
||||||
// Only change this if we want the raw key that was pressed,
|
// 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_altDown = XKeyEventAltIsDown(xevent);
|
||||||
wxevent.m_metaDown = XKeyEventMetaIsDown(xevent);
|
wxevent.m_metaDown = XKeyEventMetaIsDown(xevent);
|
||||||
wxevent.SetEventObject(win);
|
wxevent.SetEventObject(win);
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
wxevent.m_uniChar = id;
|
||||||
|
#endif
|
||||||
wxevent.m_keyCode = id;
|
wxevent.m_keyCode = id;
|
||||||
|
|
||||||
wxevent.SetTimestamp(XKeyEventGetTime(xevent));
|
wxevent.SetTimestamp(XKeyEventGetTime(xevent));
|
||||||
|
|
||||||
wxevent.m_x = XKeyEventGetX(xevent);
|
wxevent.m_x = XKeyEventGetX(xevent);
|
||||||
|
@@ -415,6 +415,7 @@ void ListBaseTestCase::EditLabel()
|
|||||||
wxUIActionSimulator sim;
|
wxUIActionSimulator sim;
|
||||||
|
|
||||||
list->EditLabel(0);
|
list->EditLabel(0);
|
||||||
|
wxYield();
|
||||||
|
|
||||||
sim.Text("sometext");
|
sim.Text("sometext");
|
||||||
wxYield();
|
wxYield();
|
||||||
|
@@ -73,6 +73,7 @@ void RadioButtonTestCase::Click()
|
|||||||
EventCounter selected(m_radio, wxEVT_RADIOBUTTON);
|
EventCounter selected(m_radio, wxEVT_RADIOBUTTON);
|
||||||
|
|
||||||
wxUIActionSimulator sim;
|
wxUIActionSimulator sim;
|
||||||
|
wxYield();
|
||||||
|
|
||||||
sim.MouseMove(m_radio->GetScreenPosition() + wxPoint(10, 10));
|
sim.MouseMove(m_radio->GetScreenPosition() + wxPoint(10, 10));
|
||||||
sim.MouseClick();
|
sim.MouseClick();
|
||||||
|
Reference in New Issue
Block a user