English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 15 October 2023, 05:28   #1
Mafi
Registered User
 
Join Date: Jul 2022
Location: Australia
Posts: 49
IDCMP messages with WA_BusyPointer

Hi again!

I use SetAttrsA with WA_BusyPointer to block input to my Reaction app whilst it's busy recursively scanning a directory. I'd like to be able to abort this scan with the ESC key. Within the scanning loop I periodically send WM_HANDLEINPUT to the blocked window to get any IDCMP messages such as IDCMP_RAWKEY, but somehow the only one I get is some "deactivate window" message, presumably becasue WA_BusyPointer opens a null/invisible requester and is blocking everything. However, my understanding is that IDCMP messages should still flow to the parent window. Am I correct in this understanding?

My window IDCMP flags are: IDCMP_GADGETUP|IDCMP_IDCMPUPDATE|IDCMP_CLOSEWINDOW|IDCMP_RAWKEY

Any hints welcomed!

Cheers,
-M
Mafi is offline  
Old 21 October 2023, 04:47   #2
Mafi
Registered User
 
Join Date: Jul 2022
Location: Australia
Posts: 49
Ok, I solved this. Probably not the ideal way. As the NULL requestor blocks all IDCMP to the parent window, I decided I'd implement an interrupt server and (de)register it with AddIntServer/RemIntServer. It seems to work quite well. Just before the scan I call AddIntServer to register the handler, when my recursive scanning is going on and the handler fires, I check to see if my parent window is the "active" one and if $bf0c01 indicates it's the ESC key. If so, I set a flag that my scanning routine can check to see if it needs to abort and unregister the interrupt server.

-M
Mafi is offline  
Old 21 October 2023, 10:06   #3
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,247
This does not look like an adequate solution, sorry. The keyboard hardware knows nothing about the input focus, and it knows nothing about requesters and the intuition state machine, and it may not even know the right state of the keyboard if the key events reach the intuition input handler through different ways, e.g. through a USB keyboard.

SetPointer() does not set any requester - it only changes the shape of the mouse pointer, and it does not interact with the event system.
Thomas Richter is offline  
Old 21 October 2023, 15:58   #4
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,043
If you are adding your int handler, I'd avoid reading HW directly ($bfec01).
Maybe try this instead, same idea but more system friendly... Set handler's priority to 51 or higher (intuition is at 50) and then traverse the event list if your window has focus (intbase->ib_ActiveWindow == your_window): check for IECLASS_RAWKEY events and then for e.g. ESC (RAWKEY_ESCAPE) or CTRL-C (IEQUALIFIER_CONTROL + RAWKEY_C).
a/b is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
New PC .... new messages :-) chip support.WinUAE 2 18 December 2019 16:04
Private Messages not possible andreas project.EAB 8 25 June 2002 23:46
Strange Messages Andrew support.Hardware 6 18 May 2002 19:29

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:01.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07699 seconds with 13 queries