http://bugs.winehq.org/show_bug.cgi?id=7874
Summary: OnHotHey function in EasyUO doesn't work Product: Wine Version: 0.9.33. Platform: PC URL: http://www.easyuo.com/ OS/Version: other Status: UNCONFIRMED Severity: normal Priority: P3 Component: wine-ipc AssignedTo: wine-bugs@winehq.org ReportedBy: zajec5@gmail.com
EasyUO is a powerfull tool that enables me to write scripts that help me to play Ultima Online (which works great under Wine). It works in 90%, expect OnHotKey function.
I asked developer if he could show a part of Delphi code that is used for this function. He was so nice he did. There it is:
**********
function OnHotkey(KeyStr : String; Ctrl,Alt,Shift : Boolean) : Boolean; var VK : Cardinal; begin Result:=False; VK:=GetVK(KeyStr); if VK=0 then Exit;
if (Hi(GetAsyncKeyState(VK))<128) then Exit; if Ctrl xor (Hi(GetAsyncKeyState(VK_CONTROL))>127) then Exit; if Alt xor (Hi(GetAsyncKeyState(VK_MENU))>127) then Exit; if Shift xor (Hi(GetAsyncKeyState(VK_SHIFT))>127) then Exit; Result:=True; end;
**********
He also gave us a little comment about it. Quote:
**********
GetVK isn't provided here, but it simply maps string names like "F1" to the corresponding Windows VirtualKey constant. The Hi() function returns the most significant byte.
Maybe the problem is the WINE implementation of GetAsyncKeyState. It might be the format of the return value or the VK mapping table.
GetAsyncKeyState on MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui... windowsuserinterface/userinput/keyboardinput/keyboardinputreference/ keyboardinputfunctions/getasynckeystate.asp
I've uploaded a test application with just GetAsyncKeyState in it here: http://www.easyuo.com/cheffe/asynckeytest.zip
In Delphi, values with a dollar sign in front are interpreted as hexadecimal. So the value $74 is actually 116 which is the key F5.
A description of all available virtual keycodes is here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI... WindowsUserInterface/UserInput/VirtualKeyCodes.asp
When I press F5 on my WinXP, I get the a result value of $FFFF8000 or $FFFF8001 (if I keep the F5 button pressed down).
**********
This bug means that I can not detect when some key is pressed inside Ultima Online window. As a result I can not for ex. bind healing my character under F1.