From mint-bounce@lists.fishpool.fi Mon Aug 23 05:38:55 2010 To: mint Subject: [MiNT] AES related question: How to keep track if my application is receiving =?UTF-8?Q?input=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 23 Aug 2010 11:36:54 +0200 From: m0n0 Reply-To: ole@monochrom.net Message-ID: <4626a43c7aba195c991d56f16cdbc5fc-EhVcX1lFRQVaRwYcDTpQCEFddQZLVF5dQUNBAjBTXF5bVkYJXVxoB1E6XF1XQ0AHWVhYRA==-webmailer2@server03.webmailer.hosteurope.de> X-Sender: ole@monochrom.net User-Agent: Host Europe Webmailer/2.0 X-HE-Access: Yes X-bounce-key: webpack.hosteurope.de;ole@monochrom.net;1282556214;1bcd4abe; X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: ole@monochrom.net Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: Hello to the list, ...Sorry for the long posting... I'm having a question regarding input handling of GEM Windows. My application need's to capture more input events than the AES evnt_() functions provide. I need to keep track of the mouse position and key up / down press. 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? 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. As far as I understand evnt_keybd / evnt_multi just informs me about key down. I looked into SDL source code how it is done there, but I have one problem with that code (explained later). I don't know if evnt_keybd queues the Keyboard events or if it just waits for one event to occur. But because of SDL's code I expect it is queuing the events... In SDL Keyup / down it is done this way: resultat = evnt_multi( event_mask, 0,0,0, mouse_event,x2,y2,w2,h2, 0,0,0,0,0, buffer, 10, &dummy,&dummy,&dummy,&kstate,&kc,&dummy ); ... if ( gem_currentkeyboard[i] && !gem_previouskeyboard[i] ) SDL_PrivateKeyboard(SDL_PRESSED, SDL_Atari_TranslateKey(i, &keysym, SDL_TRUE)); /* Key unpressed ? */ if ( gem_previouskeyboard[i] && !gem_currentkeyboard[i] ) SDL_PrivateKeyboard(SDL_RELEASED, SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE)); I expect this code is working as long as the event routine is called often enough ( before the event queue is full). But the problem I have with this code is: If I call SDL_WaitEvent( endless ); it internally enters an endless loop which calls the evnt_multi function VERY often, until an event occured. This is only true when you use the SDL GEM backend, of course. What I don't like about it: it costs to much CPU time, so I want to use another way. ehm.... anyone implemented something like this and wants to share experience, or is there some xaees special function that could help me? (something like xaaes_get_input_receiver_pid() ;) ) Anyone has information how to do it properly? Kind regards, m0n0