English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 13 August 2024, 07:06   #1
BSzili
old chunk of coal
 
BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 1,318
System friendly way of disabling repeated key events

I have a program that uses IDCMP to process key events. This works great for the most part, but the key repeat functionality generates a lot of extra IDCMP_RAWKEY messages when the key is held. I can filter them out based on the qualifier, but the program still has to process all these messages sent to the window's port.
Is there a way to prevent the repeated key IDCMP messages from being sent to the window? One idea that came to mind is a high priority input handler to preprocess the input event, but then I might as well process the events there. A global way to disable key repeat would also work, as this could be toggled when the window is activated/inactivated.
BSzili is offline  
Old 13 August 2024, 11:53   #2
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,091
1. Did you try the WA_RptQueue window tag (I think it's KS2.0+)? I haven't messed around with it, but if you set it to 0, would it disable the repeats in your window?
If that doesn't work...
2. Set repeat threshold, via input.device, to a very high value, this would affect everything though.
3. Install a custom handler for input.device with high priority, to handle rawkey events. In your handler you first check if the current window (intuibase->ActiveWindow) is your window. If yes, send a (single) event to your own message port and terminate the chain. If no, do nothing (pass the event down the chain, to input.device's own handler which will then handle the repeats).
a/b is offline  
Old 13 August 2024, 16:38   #3
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,379
If everything else fails, there is still the possibility to create another, somewhat higher priority task that will get the messages and only forward the ones that are relevant to the main process. This just needs changing the task in the message port (and some way to give key data to the main task).

Of course, at the end everything depends on why these messages are annoying at first place.
meynaf is offline  
Old 13 August 2024, 16:46   #4
BSzili
old chunk of coal
 
BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 1,318
Thanks for all the ideas, I tried WA_RptQueue and it's exactly what I was looking for. If I set it to 0 the window longer receives any repeated IDCMP_RAWKEY messages
BSzili 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
Disabling the HELP key StompinSteve support.AmigaOS 4 22 January 2024 20:42
REQ: NoiseTracker or ProTracker System friendly source redblade Coders. Asm / Hardware 4 27 February 2021 08:56
Is there a way to get key events for pageup, pagedown, insert...? softwarefailure support.WinUAE 8 10 July 2018 19:44
System friendly Protracker Replay? AGS Coders. System 2 16 August 2014 20:53
Assembler System Friendly code redblade Coders. General 3 29 July 2008 12:15

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

Top

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