[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] AES related question: How to keep track if my application is receiving input?
Am 23.08.2010, 11:36 Uhr, schrieb m0n0 <ole@monochrom.net>:
I need to keep track of the mouse position and key up / down press.
For mouse you can use a timer-event and check the mouse in between (means
polling). It works good. I don't know what you mean by key up/down: Do you
need to know if a key is released or what?
I would do this by using other TOS functions / interrupts, and then
store the data into an event pipe.
There is one problem - how do I know if I must ignore input, because the
window has lost input focus or is inactive?
When you do it clean (maybe using signal-handlers) this should be
possible. I remember having read something of integrating Fselect into
evnt_multi or similar, but cannot remember exactly. I think it was from
Henk (or in xaaes-source).
Will it be enough to watch for WM_BOTTOMED / WM_BACKDROPPED / WM_ICONIFY
/ WM_SHADED message, and if they occur, ignore further VDI mouse
/ key input until WM_TOPPED, WM_UNSHADED etc. arrives? I expect this
won't be OK, because the application could be yielded.
WM_UNTOPPED is missing at least. But I guess this can get a bit confusing
anyway.
As far as I understand evnt_keybd / evnt_multi just informs me about key
down.
How do you get this information?
What I don't like about it: it costs to much CPU time, so I want to use
another way.
It does not use much CPU to poll - I have done this for mouse using
evnt_multi-timeout and the usage is nearly 0.
experience, or is there some xaees special function that could help me?
(something like xaaes_get_input_receiver_pid() ;) )
Not that I would know of.
Anyone has information how to do it properly?
Use MU_TIMER, and request the things when you are top. Bad example of
course is aniplayer who always uses 99% CPU ..
--
Helmut Karlowski