English Amiga Board

Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

Thread Tools
Old 07 August 2020, 17:39   #1
Registered User

Join Date: May 2017
Location: Silkeborg/Denmark
Posts: 21
Checking for new windows and keyboard events

What is the best way to check for new windows on the public screen while also waiting for keyboard events?

Right now I've written some code which:

1. counts windows
2. calls WaitTOF()
3. Compares window count to previous count
4. Invokes a function if window count increased.
5. If nothing has changed it falls through to a GetMsg on a keyboard event message port.

It works, but feels a bit hacky.

I've looked into using the timer.device and feel that it is a better option to Wait(ticksignal | keyboardsignal), but frankly I am unsure. How would you approach this?

AmigaOS 3.1 btw.

Last edited by edmayn; 07 August 2020 at 18:06.
edmayn is offline  
Old 08 August 2020, 00:28   #2
Registered User
thomas's Avatar
Join Date: Jan 2002
Location: Germany
Posts: 6,185
Here is a small example which handles a timer and input from a window at the same time.
Attached Files
File Type: lha test.lha (6.0 KB, 36 views)
thomas is offline  
Old 08 August 2020, 02:04   #3
Registered User

Join Date: May 2017
Location: Silkeborg/Denmark
Posts: 21
Thank you Thomas. I'll study the example.
edmayn 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
Adelaide Events! amigaman101 News 0 15 October 2015 12:07
Amiga 30 Year Events Daedalus Amiga scene 0 22 May 2015 12:50
Keyboard problems in Windows 7 jotd support.WinUAE 10 15 July 2010 21:37
Utilise the Windows Keyboard correctly? Stom support.WinUAE 1 20 April 2003 05:48
Windows keyboard vs Amiga keys mtb support.WinUAE 3 07 September 2002 15:21

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 15:44.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.06724 seconds with 16 queries