pdx7, wxp, touchscreen (no keyboard)
i need a button which emulate vk_return
pdx help for setVChar send me to setAltKeyDown example (see at the end).
In a pushbutton method i put the following code
var
ke KeyEvent
f form
endVar
message()
if not f.attach("Restaurant") then
errorshow()
endif
ke.setVChar(VK_return)
f.keyPhysical(ke) errorshow()
and nothing happens. I could use instead something like
ui.action(moveright) but dont really like it...
thanks
marco
------------------------------------setAltKeyDown example-------------
The following example assumes a form has a box named boxOne. When the
user presses Alt+C, the keyPhysical method for the form changes the
color of boxOne. This code is attached to a form's keyPhysical method:
; thisForm::keyPhysical
method keyPhysical(var eventInfo KeyEvent)
if eventInfo.isPreFilter()
then
; code here executes for each object in form
if eventInfo.isAltKeyDown() and ; if user presses Alt+C
eventInfo.vChar() = "C" then
disableDefault ; block normal processing
; alternate a boxOne's color between red and blue
boxOne.color = iif(boxOne.color = Red, Blue, Red)
endif
else
; code here executes just for form itself
endif
endMethod
To simulate pressing Alt+C, the code for this method creates a KeyEvent
variable, then sets its virtual key character to "C" and sets the Alt
key down.
; sendAltC:

ushButton
method pushButton(var eventInfo Event)
var
ke KeyEvent
endVar
ke.setVChar("C") ; set the character to C
ke.setAltKeyDown(Yes) ; set the Alt key state to pressed
thisForm.keyPhysical(ke) ; send off the event
endMethod