English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 06 February 2022, 14:25   #1
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,189
Prevent input from reaching CLI/WB

I'm sure this must have been asked a million times, but I haven't been able to find anything (that I can get to work).

I'm trying to do some graphics stuff in a not too system-unfriendly manner so I do:

Code:
SetTaskPri(FindTask(NULL), 127);
Forbid();
LoadView(NULL);
WaitTOF();
WaitTOF();
AddIntServer(INTB_VERTB, &intr);

while (ciaa->ciapra & (1 << CIAB_GAMEPORT0)) {
    // Somewhat naughty stuff that writes to custom registers etc.
}

// restore old view / copper

Permit();
So far so good, but keyboard/mouse button presses end up in the CLI / potentially closing windows, and I'd like to avoid that. It's especially annoying that pressing e.g. escape ends up pausing the program until enter is pressed.

I've tried:
- Opening a dummy window
- Sending CMD_STOP/CMD_START (also tried throwing in CMD_RESET/CMD_FLUSH for good measure) to input.device
- Adding an input handler to input.device and just returning NULL/modifying RAWKEY/RAWMOUSE events to set NOBUTTON (Similar to the code here: https://github.com/weiju/amiga_c_mod...n/example_01.c)
- SetVBuf(Input(), NULL, BUF_NONE, -1) and draining Input()
- Looked at this post: https://eab.abime.net/showthread.php?p=1507339 and tried opening RAW: (this opens a new window, which I guess is to be expected, so maybe I would need to reopen stdin/Input()?)

Waiting for LMB to be released again before exiting the loop seems to take care of that part at least. I don't care if the keypresses are shown in console window, just that they don't pause the shell (or executed as commands).

Adding an input handler seems to almost work, but it seems to only be called after my main loop (yes, I've also tried removing Forbid/Permit, and waiting for the message port in the IORequest structure).

I know I can just bang the system on its head and fiddle with DMACON/INTENA, but that's what I'm trying to avoid...

Note: Primary using VBCC, but also tried with Bebbo's GCC.
paraj is offline  
Old 06 February 2022, 14:57   #2
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
Hi

This?:
http://eab.abime.net/showpost.php?p=...3&postcount=26
ross is offline  
Old 06 February 2022, 18:39   #3
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,189
Ross, you're the best, exactly that. Works perfectly

Seems like I was pretty close (but still too far away...), but glad I asked because I hadn't though of the pr_WindowPtr thing for requesters.
paraj 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
TYPEing rs232 serial input to CLI terminal Tavis support.Other 6 01 March 2019 02:11
how to prevent windows audio cd playpack during emulation? honx support.WinUAE 24 11 December 2018 10:48
How to prevent 100% CPU usage ? mahen support.FS-UAE 3 01 November 2017 20:19
reaching bottom screen with Copper sodapop Coders. Asm / Hardware 21 09 March 2016 19:22
will a NTSC A520 prevent me... NfernalNfluence support.Hardware 0 08 September 2007 12:07

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 21:43.

Top

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