From 7b5c438dc2ac1347fab834c1e53460d0e9c61476 Mon Sep 17 00:00:00 2001 From: Rui Guo Date: Wed, 10 Jun 2009 13:59:58 +0800 Subject: [PATCH] Descript hook/unhook intf. Also a bit about input() (questionable) --- src/drafts/scripting | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/src/drafts/scripting b/src/drafts/scripting index a126906..44ee3a0 100644 --- a/src/drafts/scripting +++ b/src/drafts/scripting @@ -202,6 +202,9 @@ int waitfor(string pattern); NOTICE: This is an asynchronous method call and can only be called in asynchronous mode. +hook([obj], event, handler, [priv]) + See the description in Screen object. + ---------- Events ---------- @@ -241,7 +244,18 @@ umask: description: The access for the window created by this user to other users. The result will be in a form of 'rwx'. -D. Screen +D. Display + + +---------- +Methods: +---------- + +input + get input from user. + + +E. Screen This is a pseudo object standing for the whole screen object. All other objects can be obtained starting from this one. @@ -254,8 +268,27 @@ displays command windowbyname -input -get input from user. +hook([obj], event, handler, [priv]) +or obj:hook(event, handler,[priv]) + + listen to the event notification. The event is associated with the specified + obj. If the obj is omitted, the event is a global event. An optional privilege + can be specified through the priv parameter. The privilege determines the + position of this handler in the chain. A smaller value has higher privilege. + This method returns a ticket (or handle) of the registration. This is used to + unregister the notification. + +unhook(ticket, handler) +or obj:unhook(ticket, handler) + + Unregister the hook. The ticket and handler must match, otherwise a false is + returned. + +-------- +Events: +-------- +cmdexecuted +detached =================== -- 2.11.4.GIT