Chip, you read my mind - that is almost exactly what I implemented yesterday 
afternoon. It was really easy to do and it works a treat.

Jeremy

> On 11 Nov 2019, at 15:06, Chip Scheide <[email protected]> wrote:
> 
> another option - depending on your view of doing this... is Code 
> injection.
> 
> At startup of the host (will have to be started at least once 
> interpretedly)
> you copy the code for the event call method into a method in the host.
> 
> it looks something like this (interpreted host and component):
> METHOD GET CODE(<method_to_inject>) 
> METHOD SET CODE(<Source_code>;<Host_New_Method_Name>)
> 
> Alternatively (compiled component and interpreted host):
> - At component shut down, write the method(s) to be injected to disk as 
> text (I use the resources folder)
> - at host or component startup read the text files
>  METHOD SET CODE(<code_from_text_file>;<Host_New_Method_Name>)
> 
> Chip
> 
> On Sun, 10 Nov 2019 18:07:01 +0000, Jeremy Roussak via 4D_Tech wrote:
>> I’d like to have a method set by ON EVENT CALL to live in a 
>> component. It works, in that the method is called on each event, but 
>> the system variables Modifiers and KeyCode are undefined so testing 
>> for the event itself is tricky.
>> 
>> I can get round the absence of Modifiers by using Macintosh control 
>> down, but I’m not sure how I get the keystroke that triggered the 
>> event.
>> 
>> Is it possible?
>> 
>> Jeremy
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to