nanogui: about nanowm
Subject:
Re: about nanowm
From:
xiang ####@####.####
Date:
22 Feb 2001 02:09:02 -0000
Message-Id: <20010222021331.16731.qmail@web11105.mail.yahoo.com>
--- Alex Holden ####@####.#### 的正文:> On
Wed, 21 Feb 2001, [gb2312] xiang lee wrote:
> > I wanna to add a hotbutton control to nanowm for
> my
>
> What's a hotbutton control?
Sorry,maybe i cann't call it "hotbutton control"
I means that an application which can receive a
message from hardware button(like PALM Vx ) and send
a event to the nanowm,in this way the hardware button
can control the windows. (for example,You can control
the scrollbar of a window only with a hardware button
)
> > At beginning,I try to find out how I can add a
> > hotbutton event to the nano-X's events ,but I find
>
> > that the most event is come from the Mouse and
> > Keyboard
>
> If you really need to add a new event type (as
> opposed to a keyboard event
> with a special key value or something):
>
> In include/nano-X.h :
> Add a new GR_EVENT_TYPE_ #define.
> Add a new GR_EVENT_MASK_ #define.
> Add a new GR_EVENT_ structure definition. Note that
> it has to start with
> a GR_EVENT_TYPE value.
> Add the structure to the GR_EVENT union.
>
> In nanox/srvevent.c :
> Add a GsDeliverYourEvent() function which looks
> through the
> rootwp->eventclients list for windows which have
> selected to receive the
> event, and when you find one which you want to send
> an event to, use
> GsAllocEvent() to allocate a new event structure
> then just fill it in
> (then forget about it- GsAllocEvent() adds it to the
> event list so you
> don't have to).
>
> You will then need to call the GsDeliverYourEvent()
> function whenever you
> want to generate your event. How you do this depends
> on the application
> (specifically, how the server decides that it wants
> to generate an event).
Thanks,I think this way is too difficult for me.
Currently I can only read "0" or "1" from the hardware
buttons,In your means,I must register my event to the
X-server?
> > Then I try to got windows message from nanowm
> and
> > save it in my apps ,when the hotbutton message
> coming
> > this apps send command to nanowm.
>
> I don't understand.
..My Engish is not good enough to express my means,
sorry ,I send you codes,I think you will known what
i means.
In the nanowm.c ln28-ln31 ln102-ln115
In the clients.c ln136-ln142
rp.c is read test which get window->wid from wmpipe
wp.c is write test which put window->wid to mappipe
Best Regards
liex
_________________________________________________________
Do You Yahoo!? 登录免费雅虎电邮! http://mail.yahoo.com.cn
创建雅虎俱乐部,真我个性尽施展!http://cn.clubs.yahoo.com
[Content type application/x-zip-compressed not shown. Download]