Generate correct events for extended keys in wxMSW wxUIActionSimulator.
Simulating keys such as WXK_END resulted in WXK_NUMPAD_END event being generated instead of the expected WXK_END one. Fix this by returning from wxCharCodeWXToMSW() whether the key code is a normal or extended one and use this to set KEYEVENTF_EXTENDEDKEY in wxUIActionSimulator::DoKey(). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -74,8 +74,16 @@ bool wxUIActionSimulator::MouseUp(int button)
|
||||
bool
|
||||
wxUIActionSimulator::DoKey(int keycode, int WXUNUSED(modifiers), bool isDown)
|
||||
{
|
||||
DWORD vkkeycode = wxCharCodeWXToMSW(keycode);
|
||||
keybd_event(vkkeycode, 0, isDown ? 0 : KEYEVENTF_KEYUP, 0);
|
||||
bool isExtended;
|
||||
DWORD vkkeycode = wxCharCodeWXToMSW(keycode, &isExtended);
|
||||
|
||||
DWORD flags = 0;
|
||||
if ( isExtended )
|
||||
flags |= KEYEVENTF_EXTENDEDKEY;
|
||||
if ( !isDown )
|
||||
flags |= KEYEVENTF_KEYUP;
|
||||
|
||||
keybd_event(vkkeycode, 0, flags, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user