Let me see if I've got this right. You wish to pass every keystroke to a library and then do something during the library method based on that keystroke?
The only thing that might work would be to return a string containing the instuctions (or "None"

, then use executeString to do it.
For example, here is a BS library function that I simulated as a method. You would want to use a case/switch statement to get all the possible key events you plan to do something with:
Code:
method LibFunc(var eventInfo KeyEvent) string
if eventInfo.vCharCode() = VK_F9
then return "var myForm form endvar
if not myForm.attach(\"Test\")
then errorShow() endif
myForm.textBox.value=\"F9\""
else return "None"
endif
endMethod
And here is the form's keyPhysical event
Code:
method keyPhysical(var eventInfo KeyEvent)
var
retCmd string
endvar
if eventInfo.isPreFilter() then
;// This code executes for each object on the form
disableDefault
retcmd=LibFunc(eventInfo)
if retCmd = "None" then doDefault
else executeString(retCmd)
endif
else
;// This code executes only for the form
endIf
endMethod
The above assumes a form with the title of "Test" containing a text field called "textBox".
I just did something simple for my test, changing the contents of a textbox. It also needs some sprucing up, since you'll want to actually pass the title value of the calling form using self.title so the library can know which form to attach to.
Like I said, this is a very simple example and it was a quick I-wonder-if-I-can-do-that exercise for me, so use with caution. Lance may have some better ideas or flaws I've overlooked.
Mac
"There are only 10 kinds of people in this world... those who understand binary and those who don't"
langley_mckelvy@cd4.co.harris.tx.us