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

[ALLY] event! experiment...

 [1/10] from: cyphre::volny::cz at: 19-Jun-2001 12:37


Hi list, This question is probably for Holger but feel free to respond ;-) Holger some time ago said that there may be possibility to create/change /View events. I played with this idea a bit but with a small succes :(( How can I create my own event!, I cannot understand the structure of this datatype... Here are my observations: I hard-hacked wake-event function which is probably the first point where events are sent from event-port: system/view/wake-event: func [port /local event] [event: pick port 1 probe reduce [event/1 event/2 event/3 event/4 event/5 event/6] false] then try to view something: view layout [button "test"] and the results were: event/1 is type flag event/2 is key flag event/3 is offset pair event/4 is time stamp event/5 is shift flag event/6 is control flag event/7 is face object (this is not in the hack above because of too big face-listing (-; ) (I can continue is there any onther parameters (probably secret (-; ) ? but how can I change it??? event/1: 'close ** Script Error: Invalid path value: 1 ** Where: wake-event ** Near: event/1: 'close probe reduce [event/1 event/2 event/3 event/4 event/5 event/6]
>>
any ideas?? Reagrds, Cyphre PS: I hope someone (probably Holger) will react on that and don't keep in secret this possible feature for allies ;-)

 [2/10] from: cyphre:volny:cz at: 20-Jun-2001 9:18


Hi Anton,
> There is also event/8, but it always seems false. > I haven't seen if it becomes true. >
yes this is also strange behaviour of event! you can try for example event/10000 and it returns always false ?!? Cyphre

 [3/10] from: holger:rebol at: 20-Jun-2001 9:37


On Wed, Jun 20, 2001 at 02:19:29PM +1000, Anton wrote:
> There is also event/8, but it always seems false. > I haven't seen if it becomes true.
event/8 is the double-click flag. -- Holger Kruse [holger--rebol--com]

 [4/10] from: holger:rebol at: 20-Jun-2001 9:41


On Wed, Jun 20, 2001 at 07:47:34PM +1000, Allen Kamp wrote:
> Event Refinements > /type Returns event type. The event types are:
<<quoted lines omitted: 14>>
> i.. 'inactive - window inactive, occurs when window becomes inactive > as when another application becomes active
Also: 'scroll-line and 'scroll-page for the mouse wheel. -- Holger Kruse [holger--rebol--com]

 [5/10] from: cyphre:volny:cz at: 20-Jun-2001 12:11


Hi Allen, Thanks for the info. Yes, I know that but still cannot find answer how to modify/create envent! structure (if it is possible) . RT anyone? regards Cyphre

 [6/10] from: arolls:bigpond:au at: 20-Jun-2001 14:19


There is also event/8, but it always seems false. I haven't seen if it becomes true. Anton.

 [7/10] from: allenk:powerup:au at: 20-Jun-2001 19:47


----- Original Message ----- From: "Anton" <[arolls--bigpond--net--au]> To: <[ally-list--rebol--com]> Sent: Wednesday, June 20, 2001 2:19 PM Subject: [ALLY] Re: event! experiment...
> There is also event/8, but it always seems false. > I haven't seen if it becomes true.
<<quoted lines omitted: 7>>
> > event/7 is face object (this is not in the hack above because of too big > > face-listing (-; )
This will probably loose all the formatting along the way (from the event refinements table at http://www.rebolforces.com/archive/view099users.html#Events ) Event Refinements /type Returns event type. The event types are: a.. 'down, 'middle-down, 'right-down - mouse down event for the left, middle or right mouse button (pressing down on the mouse button) b.. 'up, 'middle-up, 'right-up - mouse up event for the left, middle, or right mouse button (releasing the mouse button) c.. 'move - mouse move event (position of the mouse cursor over a REBOL/View window d.. 'key - keyboard event (keyboard input) e.. 'time - time event (unique time index - latest event has the highest number) f.. 'resize - resize window event (whenever the window is resized) g.. 'close - close window event (exiting the REBOL/View window session) h.. 'active - window active, occurs when window becomes active again after being inactive while another application was active i.. 'inactive - window inactive, occurs when window becomes inactive as when another application becomes active /offset Returns the mouse cursor offset relative to the REBOL/View window. The offset returned has different meaning depending on the event type: a.. 'down, 'middle-down, 'right-down - the offset when the mouse button is pressed. b.. 'up, 'middle-down, 'right-down - the offset when the mouse button is released. c.. 'move - the offset at the moment the mouse is moved. The frequency at which mouse move events are sent to the event port will vary per system. When the mouse cursor is outside the REBOL/View window, no move events are sent to the event port. d.. 'key - the mouse cursor offset at the moment of keyboard input. When the mouse cursor is outside the REBOL/View window and a keyboard event occurs, the offset value will be positive or negative of the current REBOL/View window size. e.. 'time - the offset of the mouse at the moment the event is sent. f.. 'resize - the offset of the mouse as the window is being resized. Resize events are sent every as the window is being resized. /key Returns the ASCII character relative to the event. With 'key events, this returns the character pressed that triggered the event. The only exceptions are the arrow keys Up, Down, Left, Right, and the End and Home keys. These key events are handled internally by REBOL for changing the caret position in edit windows. These key events return word representations. The word representations for the Up, Down, Left, Right, End and Home keys are 'up, 'down, 'left, 'right, 'end or 'home, respectively. For the mouse up and down events as well as 'time , 'resize and 'move, the character returned is always #"^@", which is represented in REBOL as a null character. /control Returns a logic value, true or false, depending on whether the control key is pressed when the event is sent. This works with the mouse up and down events as well as 'move, 'key, 'resize and 'time. /shift Returns a logic value, true or false, depending on whether the shift key is pressed when the event is sent. This works with the mouse up and down events as well as 'move, 'key, 'resize and 'time. /time Returns an integer representing a unique time index for the event. /face Returns the top-level face object of the window that was active when the event occurred. Cheers, Allen K

 [8/10] from: holger:rebol at: 21-Jun-2001 9:30


On Tue, Jun 19, 2001 at 12:37:26PM +0200, Richard Smolak wrote:
> Hi list, > > This question is probably for Holger but feel free to respond ;-) > > Holger some time ago said that there may be possibility to create/change > /View events. I played with this idea a bit but with a small succes :(( > > How can I create my own event!, I cannot understand the structure of this > datatype...
At the moment you cannot. -- Holger Kruse [holger--rebol--com]

 [9/10] from: cyphre:volny:cz at: 21-Jun-2001 10:07


Holger, could you answer/describe if it is possible modify/create envent! structure. If it is not possible or "secure-feature" just tell me "no" please so I don't waste my time on this topic. Thank you, Cyphre

 [10/10] from: rgaither:triad:rr at: 21-Jun-2001 13:11


I've replied to both lists because I think the event driven paradigm is important for core as well as view.
>> This question is probably for Holger but feel free to respond ;-) >>
<<quoted lines omitted: 4>>
>> datatype... >At the moment you cannot.
I'm going to be optimistic and read into this that RT is at least considering putting that option in. :-) While on the topic of event driven programming I'd like to share some "experience" from another language that grew "badly" into the event driven paradigm. List of mistakes I hope REBOL can avoid - 1. Event driven is not just for user interfaces. Publish and subscribe for example work for all kinds of design problems. 2. A language should provide the plumbing for event handling but leave the usage/definitions open for developers to extend. Fits well in the current native versus mezzanine layers REBOL uses. 3. Event handling needs to be designed with external connections in mind. For example - while connections from a client to an application server were already possible the initial event mechanism was limited to each session and could not use the existing communications pipeline. Off the top of my head I'm thinking we need system level event handling and an event datatype that developers can use however they want. Thats enough to get started. :-) Thanks, Rod. Rod Gaither Oak Ridge, NC - USA [rgaither--triad--rr--com]

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted