However I have had to do this kind of thing in order to get it to work.
Example from ini file
Code: Select all
///////////////////////////////////////////////////////////////////////////////
key1txt=Mix 1
key1mod=CTRL+ALT
key1key=114
key1col=Green
///////////////////////////////////////////////////////////////////////////////
Code: Select all
SRT>PRESSKEYS
// mainkey is read from the key1txt of the ini file
// modkey is read from key1mod of ini file
Let>mainkey=VK%mainkey%
RegEx>%patternc%,%modkey%,0,ctrlarr,ctrlmatches,0,,
RegEx>%patterna%,%modkey%,0,altarr,altmatches,0,,
RegEx>%patterns%,%modkey%,0,shiftarr,shiftmatches,0,,
IF>%ctrlmatches%>0
Press CTRL
ENDIF
IF>%altmatches%>0
Press ALT
ENDIF
IF>%shiftmatches%>0
Press SHIFT
ENDIF
Wait>%waits% // this will be 0.03 at the moment
ObjectSendKeys>%hWndParent%,%mainkey%
//
IF>%ctrlmatches%>0
Release CTRL
ENDIF
IF>%altmatches%>0
Release ALT
ENDIF
IF>%shiftmatches%>0
Release SHIFT
ENDIF
END>PRESSKEYS
If I include the modifier keys in the "ObjectSendKeys" command, it fails. So I have to send them separately, as seen above. This seems to work Ok but sometimes still fails.
Also I am having to make sure %mainkey% is a vk "VK114" for example.
I wish there was a way to allow the user to enter the actual key in my ini file rather than having to ask them to lookup the v key number.
I don't really want to make a big conversion table in the code.
I was just wondering if anyone has found any interesting ways to deal with this scenario?