Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Event datatype

From: cyphre:seznam:cz at: 29-Aug-2002 11:58

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