thanks!
this works for me.
but I noticed I have to patch in-window? cause there is a bug in it (v1.2.10)!
if you source the code, you will notice that the last call to in-window is incorrectly
typed as in-window instead of in-window?
here is fixed version... for those who are listening:
in-window?: func [
"Return true if a window contains a given face."
window face
][
if face = window [return true]
if none? face/parent-face [return false]
in-window? window face/parent-face
]
-MAx
---
"You can either be part of the problem or part of the solution, but in the end, being
part of the problem is much more fun."
> -----Original Message-----
> From: Gabriele Santilli [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 21, 2004 4:05 AM
> To: Maxim Olivier-Adlhoch
> Subject: [REBOL] Re: key events... hacking...
>
>
>
> Hi Maxim,
>
> On Wednesday, January 21, 2004, 12:23:35 AM, you wrote:
>
> MOA> Is anyone capable of getting keyboard events for faces
> MOA> which are not "focused", short of rewriting the whole event
> MOA> handler?
>
> This is a modified window feel I use in some applications; it
> allows to focus any face using CUSTOM-FOCAL-FACE. You just need to
> set it to the face you want to focus. (You might want to discard
> all the other changes.)
>
> ; support for custom-focal-face
> insert tail second :unfocus
> [ if object? get/any 'custom-focal-face [custom-focal-face: none]]
>
> ; new window feel, to catch active, inactive and close.
> ; update: catch keys too, but without interfering with focused faces;
> ; also, now the whole event is passed to window/action
> ; update: now ESC unfocuses, too
> ; update: custom-focal-face added
> system/view/window-feel:
> make system/view/window-feel
> [ detect:
> func [face event /local f]
> [ either event/type = 'key
> [ either all [system/view/focal-face
> in-window? face system/view/focal-face]
> [ if event/key = #"^(1B)"
> [ unfocus]
> event
> ]
> [ either all [object? get/any
> 'custom-focal-face in-window? face custom-focal-face]
> [ custom-focal-face/feel/engage
> custom-focal-face 'key event
> none
> ]
> [ do-face face event
> either f: find-key-face face event/key
> [ do-face f event
> none
> ]
> [ event]
> ] ] ]
> [ if find [close active inactive] event/type
> [ do-face face event]
> event
> ] ] ]
>
> Regards,
> Gabriele.
> --
> Gabriele Santilli <[EMAIL PROTECTED]> -- REBOL Programmer
> Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/
>
> --
> To unsubscribe from this list, just send an email to
> [EMAIL PROTECTED] with unsubscribe as the subject.
>
>
--
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.