Hi guys,

Yes, I was experimenting with possibilities of event! datatype.
Unfortunately, the event! datatype is a bit hardcoded,we could make its own
events but we cannot modify them(or at least I havent found any way how to
do it). The events have "invisible" behaviour ;-)  for example see this
console session:

>> my-event: make event! []
==
>> probe my-event

==
>> events: copy []
== []
>> insert events my-event
== []
>> probe events
[]
== []
>> length? events
== 1
>> type? events/1
== event!
>>

but the event looks inside ok:

>> my-event: make event! []
==
>> my-event/1 ;which means event/type
== down
>> my-event/2 ;which means event/key
== none
>> my-event/3 ;which means event/offset
== 0x0
>> my-event/4 ;which means event/time
== 0
>> my-event/5 ;which means event/shift
== false
>> my-event/6  ;which means event/control
== false
>> my-event/7 ;which means event/face
== none
>> my-event/8 ;which means event/double-click
== false

unfortunately, when trying modify my custom event:

>> my-event: make event! [type: up key: #"k" offset: 10x10 time: 12345
shift: false control: false face: none double-click: false]
==
>> my-event/1
== down
>> my-event/2
== none
>> my-event/3
== 0x0
>> my-event/4
== 0
>> my-event/5
== false
>> my-event/6
== false
>> my-event/7
== none
>> my-event/8
== false
>>

or even:

>> my-event/1
== down
>> my-event/1: 'up
** Script Error: Invalid path value: 1
** Near: my-event/1: 'up
>>

The only thing we can do with events is to catch them and replay them. See
my example script here: http://www.rebol.cz/~cyphre/event-recorder.r

This is really great feature! What do you think? But there is one drawback.
Since the events are "invisible" we cannot store them or stream over TCP
etc. What a pity. Could you imagine the possibilities? GUI apps with remote
control!

I hope RT enhance event! datatype for wider usage from the rebol developer
side.

If you know/find something more about event! datatype dont hesitate to share
it on the list!

best regards,

Cyphre


----- Original Message -----
From: "Petr Krenzelok" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 28, 2002 8:37 PM
Subject: [REBOL] Re: Event datatype


> Gregg Irwin wrote:
>
> >Hi Carl,
> >
> ><< Is there any way to modify the event datatype?  For instance, change
> >the event/key value to something else? >>
> >
> >I tried briefly once, but couldn't do it. For my purposes (key-mapping) I
> >just acted on the keys as they came in.
> >
> >--Gregg
> >
> >
> >
> IIRC, Cyphre was able to catch and store events, and later replay them.
> But event itself seems to be a strange hybrid :-) I think that it was
> purpose to hide its internals. IIRC, it was also planned by RT one day
> we will be able to generate events ...
>
> btw - was anyone successfull in system:// port usage? Any code example?
:-)
>
> -pekr-
>
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>
>
>

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to